From e22fda1beada8f0bb3b02fe80dfa1cbd80e98ba6 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 12 Sep 2005 21:51:17 +0000 Subject: [PATCH] * (bug 3448) Set page_len on undelete --- RELEASE-NOTES | 2 ++ includes/SpecialUndelete.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index db2dc73074..eda755b927 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 4e70a6b534..271c56d50f 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -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, -- 2.20.1