merged master
[lhc/web/wiklou.git] / includes / job / DoubleRedirectJob.php
index b6f54ea..54cba3a 100644 (file)
@@ -94,16 +94,17 @@ class DoubleRedirectJob extends Job {
                        wfDebug( __METHOD__.": target redirect already deleted, ignoring\n" );
                        return true;
                }
-               $text = $targetRev->getText();
-               $currentDest = Title::newFromRedirect( $text );
+               $content = $targetRev->getContent();
+               $currentDest = $content->getRedirectTarget();
                if ( !$currentDest || !$currentDest->equals( $this->redirTitle ) ) {
                        wfDebug( __METHOD__.": Redirect has changed since the job was queued\n" );
                        return true;
                }
 
                # Check for a suppression tag (used e.g. in periodically archived discussions)
+               $text = ContentHandler::getContentText( $content );
                $mw = MagicWord::get( 'staticredirect' );
-               if ( $mw->match( $text ) ) {
+               if ( $mw->match( $text ) ) { #FIXME: add support for this to ContentHandler/Content
                        wfDebug( __METHOD__.": skipping: suppressed with __STATICREDIRECT__\n" );
                        return true;
                }
@@ -129,7 +130,7 @@ class DoubleRedirectJob extends Job {
                # so the regex has to be fairly general
                $newText = preg_replace( '/ \[ \[  [^\]]*  \] \] /x',
                        '[[' . $newTitle->getFullText() . ']]',
-                       $text, 1 );
+                       $text, 1 ); #FIXME: need a way to do this via ContentHandler!
 
                if ( $newText === $text ) {
                        $this->setLastError( 'Text unchanged???' );