* (bug 6886) PHP undefined offset on bad input to Special:Revisiondelete
authorRotem Liss <rotem@users.mediawiki.org>
Sat, 9 Sep 2006 09:33:56 +0000 (09:33 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Sat, 9 Sep 2006 09:33:56 +0000 (09:33 +0000)
* (bug 6887) PHP error for call to getId() on bad input to Special:Revisiondelete
* (bug 6888) PHP error for call to getTimestamp() on bad input to Special:Revisiondelete

RELEASE-NOTES
includes/SpecialRevisiondelete.php
languages/MessagesEn.php
languages/MessagesHe.php

index 03f41e9..d78c081 100644 (file)
@@ -186,6 +186,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Localized page numbers in drop-down for DjVu page selection
 * Fixed linktrail for vi
 * (bug 6893) "Call to a member function exists() on a non-object" on trackback.php with bad input
+* (bug 6886) PHP undefined offset on bad input to Special:Revisiondelete
+* (bug 6887) PHP error for call to getId() on bad input to Special:Revisiondelete
+* (bug 6888) PHP error for call to getTimestamp() on bad input to Special:Revisiondelete
 
 == Languages updated ==
 
index 7fa8bbb..93ea1c4 100644 (file)
@@ -13,7 +13,7 @@ function wfSpecialRevisiondelete( $par = null ) {
        global $wgOut, $wgRequest, $wgUser;
        
        $target = $wgRequest->getVal( 'target' );
-       $oldid = $wgRequest->getInt( 'oldid' );
+       $oldid = $wgRequest->getIntArray( 'oldid' );
        
        $sk = $wgUser->getSkin();
        $page = Title::newFromUrl( $target );
@@ -23,6 +23,11 @@ function wfSpecialRevisiondelete( $par = null ) {
                return;
        }
        
+       if( is_null( $oldid ) ) {
+               $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+               return;
+       }
+       
        $form = new RevisionDeleteForm( $wgRequest );
        if( $wgRequest->wasPosted() ) {
                $form->submit( $wgRequest );
@@ -58,13 +63,15 @@ class RevisionDeleteForm {
        function show( $request ) {
                global $wgOut, $wgUser;
 
-               $first = $this->revisions[0];
-               
                $wgOut->addWikiText( wfMsg( 'revdelete-selected', $this->page->getPrefixedText() ) );
                
                $wgOut->addHtml( "<ul>" );
                foreach( $this->revisions as $revid ) {
                        $rev = Revision::newFromTitle( $this->page, $revid );
+                       if( !isset( $rev ) ) {
+                               $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+                               return;
+                       }
                        $wgOut->addHtml( $this->historyLine( $rev ) );
                        $bitfields[] = $rev->mDeleted; // FIXME
                }
@@ -180,6 +187,9 @@ class RevisionDeleter {
                // To work!
                foreach( $items as $revid ) {
                        $rev = Revision::newFromId( $revid );
+                       if( !isset( $rev ) ) {
+                               return false;
+                       }
                        $this->updateRevision( $rev, $bitfield );
                        $this->updateRecentChanges( $rev, $bitfield );
                        
index a1abcc6..b54b1cc 100644 (file)
@@ -919,6 +919,9 @@ Try [[Special:Search|searching on the wiki]] for relevant new pages.',
 # Revision deletion
 #
 'revisiondelete' => 'Delete/undelete revisions',
+'revdelete-nooldid-title' => 'No target revision',
+'revdelete-nooldid-text' => 'You have not specified target revision or revisions
+to perform this function on.',
 'revdelete-selected' => 'Selected revision of [[:$1]]:',
 'revdelete-text' => "Deleted revisions will still appear in the page history,
 but their text contents will be inaccessible to the public.
index 1d0195c..e2a01c0 100644 (file)
@@ -754,6 +754,8 @@ $messages = array(
 
 # Revision deletion
 "revisiondelete"            => "מחיקת ושחזור גרסאות",
+"revdelete-nooldid-title"   => "אין גרסת מטרה",
+"revdelete-nooldid-text"    => "לא ציינתם גרסת או גרסאות מטרה עליהן תבוצע פעולה זו.",
 "revdelete-selected"        => "הגרסאות שנבחרו של [[:$1]]:",
 "revdelete-text"            => "גרסאות מחוקות עדיין יופיעו בהיסטוריית הדף, אך התוכן שלהן לא יהיה זמין לציבור.