Only run hooks if Hooks.php has been loaded (i.e. we CAN run them)
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 22 Aug 2008 13:02:49 +0000 (13:02 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 22 Aug 2008 13:02:49 +0000 (13:02 +0000)
includes/SiteConfiguration.php

index 3c25377..6a1a863 100644 (file)
@@ -221,7 +221,8 @@ class SiteConfiguration {
                $site = NULL;
                $lang = NULL;
                
-               if (!wfRunHooks( 'SiteFromDB', array( $db, &$site, &$lang ) ) )
+               // Only run hooks if they *can* be run.
+               if (function_exists( 'wfRunHooks' ) && !wfRunHooks( 'SiteFromDB', array( $db, &$site, &$lang ) ) )
                        return array( $site, $lang );
                foreach ( $this->suffixes as $suffix ) {
                        if ( $suffix === '' ) {