avoid php FATAL error when Parser_OldPP is used
authorKrzysztof Krzyzaniak <eloy@users.mediawiki.org>
Fri, 25 Jul 2008 15:39:12 +0000 (15:39 +0000)
committerKrzysztof Krzyzaniak <eloy@users.mediawiki.org>
Fri, 25 Jul 2008 15:39:12 +0000 (15:39 +0000)
maintenance/refreshLinks.inc

index 6d68e27..036d410 100644 (file)
@@ -17,7 +17,9 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $red
        $wgUser->setOption('math', MW_MATH_SOURCE);
 
        # Don't generate extension images (e.g. Timeline)
-       $wgParser->clearTagHooks();
+       if( method_exists( $wgParser, "clearTagHooks" ) ) {
+               $wgParser->clearTagHooks();
+       }
 
        # Don't use HTML tidy
        $wgUseTidy = false;
@@ -110,13 +112,13 @@ function fixRedirect( $id ){
 
 function fixLinksFromArticle( $id ) {
        global $wgTitle, $wgParser;
-       
+
        $wgTitle = Title::newFromID( $id );
        $dbw = wfGetDB( DB_MASTER );
 
        $linkCache =& LinkCache::singleton();
        $linkCache->clear();
-       
+
        if ( is_null( $wgTitle ) ) {
                return;
        }