* (bug 3292) Fix move-over-redirect test when current entries are not plaintext
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 2 Sep 2005 04:44:15 +0000 (04:44 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 2 Sep 2005 04:44:15 +0000 (04:44 +0000)
Patch by Tietew: http://bugzilla.wikimedia.org/attachment.cgi?id=834&action=view

RELEASE-NOTES
includes/Title.php

index b5cf346..4c50dfe 100644 (file)
@@ -77,6 +77,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * Security fix for Special:Upload license selection list
 * Don't override edit conflict suppression on section edits; section merging
   should provide the expected transparency here and fits usage patterns better.
+* (bug 3292) Fix move-over-redirect test when current entries are not plaintext
 
 
 === Caveats ===
index 9616051..3c38f45 100644 (file)
@@ -1866,7 +1866,7 @@ class Title {
                # Is it a redirect?
                $id  = $nt->getArticleID();
                $obj = $dbw->selectRow( array( 'page', 'revision', 'text'),
-                       array( 'page_is_redirect','old_text' ),
+                       array( 'page_is_redirect','old_text','old_flags' ),
                        array( 'page_id' => $id, 'page_latest=rev_id', 'rev_text_id=old_id' ),
                        $fname, 'FOR UPDATE' );
 
@@ -1874,14 +1874,18 @@ class Title {
                        # Not a redirect
                        return false;
                }
+               $text = Revision::getRevisionText( $obj );
 
                # Does the redirect point to the source?
-               if ( preg_match( "/\\[\\[\\s*([^\\]\\|]*)]]/", $obj->old_text, $m ) ) {
+               if ( preg_match( "/\\[\\[\\s*([^\\]\\|]*)]]/", $text, $m ) ) {
                        $redirTitle = Title::newFromText( $m[1] );
                        if( !is_object( $redirTitle ) ||
                                $redirTitle->getPrefixedDBkey() != $this->getPrefixedDBkey() ) {
                                return false;
                        }
+               } else {
+                       # Fail safe
+                       return false;
                }
 
                # Does the article have a history?