* (bug 3448) Set page_len on undelete
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Sep 2005 21:51:17 +0000 (21:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Sep 2005 21:51:17 +0000 (21:51 +0000)
RELEASE-NOTES
includes/SpecialUndelete.php

index db2dc73..eda755b 100644 (file)
@@ -95,6 +95,8 @@ fully support the editing toolbar, but was found to be too confusing.
 * Fix edit on double-click for move-protected pages in Classic skin
 * Fix scaling of non-integer SVG unit sizes
 * (bug 3408) Bulgarian formatNum corrected
+* (bug 3448) Set page_len on undelete
+
 
 === Caveats ===
 
index 4e70a6b..271c56d 100644 (file)
@@ -227,10 +227,22 @@ class PageArchive {
                        );
                $revision = null;
                while( $row = $dbw->fetchObject( $result ) ) {
+                       if( $row->ar_text_id ) {
+                               // Revision was deleted in 1.5+; text is in
+                               // the regular text table, use the reference.
+                               // Specify null here so the so the text is
+                               // dereferenced for page length info if needed.
+                               $revText = null;
+                       } else {
+                               // Revision was deleted in 1.4 or earlier.
+                               // Text is squashed into the archive row, and
+                               // a new text table entry will be created for it.
+                               $revText = Revision::getRevisionText( $row, 'ar_' );
+                       }
                        $revision = new Revision( array(
                                'page'       => $pageId,
                                'id'         => $row->ar_rev_id,
-                               'text'       => Revision::getRevisionText( $row, 'ar_' ),
+                               'text'       => $revText,
                                'comment'    => $row->ar_comment,
                                'user'       => $row->ar_user,
                                'user_text'  => $row->ar_user_text,