Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -286,12 +286,9 @@ |
287 | 287 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
288 | 288 | // Different revision types use different URL params... |
289 | 289 | $key = $paramArray[0]; |
290 | | - // Link to each hidden object ID, $paramArray[1] is the url param |
| 290 | + // $paramArray[1] is a CVS of the IDs |
291 | 291 | $Ids = explode( ',', $paramArray[1] ); |
292 | | - $revParams = ''; |
293 | | - foreach( $Ids as $n => $id ) { |
294 | | - $revParams .= '&' . urlencode($key) . '[]=' . urlencode($id); |
295 | | - } |
| 292 | + $query = urlencode($paramArray[1]); |
296 | 293 | $revert = array(); |
297 | 294 | // Diff link for single rev deletions |
298 | 295 | if( $key === 'oldid' && count($Ids) == 1 ) { |
— | — | @@ -300,22 +297,21 @@ |
301 | 298 | 'diff='.intval($Ids[0])."&unhide=1&token=$token" ); |
302 | 299 | } |
303 | 300 | // View/modify link... |
304 | | - $revert[] = $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'], |
305 | | - 'target=' . $title->getPrefixedUrl() . $revParams ); |
| 301 | + $revert[] = $this->skin->makeKnownLinkObj( $revdel, |
| 302 | + $this->message['revdel-restore'], "$key=$query" ); |
| 303 | + // Pipe links |
306 | 304 | $revert = '(' . implode(' | ',$revert) . ')'; |
307 | 305 | } |
308 | 306 | // Hidden log items, give review link |
309 | 307 | } else if( self::typeAction($row,array('delete','suppress'),'event','deleterevision') ) { |
310 | 308 | if( count($paramArray) == 1 ) { |
311 | 309 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
| 310 | + // $paramArray[1] is a CVS of the IDs |
312 | 311 | $Ids = explode( ',', $paramArray[0] ); |
| 312 | + $query = urlencode($paramArray[0]); |
313 | 313 | // Link to each hidden object ID, $paramArray[1] is the url param |
314 | | - $logParams = ''; |
315 | | - foreach( $Ids as $n => $id ) { |
316 | | - $logParams .= '&logid[]=' . intval($id); |
317 | | - } |
318 | 314 | $revert = '(' . $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'], |
319 | | - 'target=' . $title->getPrefixedUrl() . $logParams ) . ')'; |
| 315 | + 'target='.$title->getPrefixedUrl()."&logid=$query" ) . ')'; |
320 | 316 | } |
321 | 317 | // Self-created users |
322 | 318 | } else if( self::typeAction($row,'newusers','create2') ) { |
— | — | @@ -370,7 +366,7 @@ |
371 | 367 | } else { |
372 | 368 | $target = SpecialPage::getTitleFor( 'Log', $row->log_type ); |
373 | 369 | $query = array( 'target' => $target->getPrefixedDBkey(), |
374 | | - 'logid[]' => $row->log_id |
| 370 | + 'logid' => $row->log_id |
375 | 371 | ); |
376 | 372 | $del = $this->skin->revDeleteLink( $query, self::isDeleted( $row, LogPage::DELETED_RESTRICTED ) ); |
377 | 373 | } |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -789,7 +789,7 @@ |
790 | 790 | $q = array(); |
791 | 791 | $q[] = 'action=delete'; |
792 | 792 | if( !$iscur ) |
793 | | - $q[] = 'oldimage[]=' . urlencode( $img ); |
| 793 | + $q[] = 'oldimage=' . urlencode( $img ); |
794 | 794 | $row .= $this->skin->makeKnownLinkObj( |
795 | 795 | $this->title, |
796 | 796 | wfMsgHtml( $iscur ? 'filehist-deleteall' : 'filehist-deleteone' ), |
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -25,17 +25,18 @@ |
26 | 26 | return; |
27 | 27 | } |
28 | 28 | $this->skin =& $wgUser->getSkin(); |
29 | | - # Set title and such |
30 | 29 | $this->setHeaders(); |
31 | 30 | $this->outputHeader(); |
32 | 31 | $this->wasPosted = $wgRequest->wasPosted(); |
33 | | - # Handle our many different possible input types |
| 32 | + # Set title and such |
34 | 33 | $this->target = $wgRequest->getText( 'target' ); |
35 | | - $this->oldids = $wgRequest->getArray( 'oldid' ); |
36 | | - $this->artimestamps = $wgRequest->getArray( 'artimestamp' ); |
37 | | - $this->logids = $wgRequest->getArray( 'logid' ); |
38 | | - $this->oldimgs = $wgRequest->getArray( 'oldimage' ); |
39 | | - $this->fileids = $wgRequest->getArray( 'fileid' ); |
| 34 | + # Handle our many different possible input types. |
| 35 | + # Use CVS, since the cgi handling will break on arrays. |
| 36 | + $this->oldids = array_filter( explode( ',', $wgRequest->getVal('oldid') ) ); |
| 37 | + $this->artimestamps = array_filter( explode( ',', $wgRequest->getVal('artimestamp') ) ); |
| 38 | + $this->logids = array_filter( explode( ',', $wgRequest->getVal('logid') ) ); |
| 39 | + $this->oldimgs = array_filter( explode( ',', $wgRequest->getVal('oldimage') ) ); |
| 40 | + $this->fileids = array_filter( explode( ',', $wgRequest->getVal('fileid') ) ); |
40 | 41 | # For reviewing deleted files... |
41 | 42 | $this->file = $wgRequest->getVal( 'file' ); |
42 | 43 | # Only one target set at a time please! |
— | — | @@ -112,11 +113,11 @@ |
113 | 114 | } else if( $this->deleteKey == 'logid' ) { |
114 | 115 | $this->showLogItems(); |
115 | 116 | } |
116 | | - # Show relevant lines from the deletion log. This will show even if said ID |
117 | | - # does not exist...might be helpful |
| 117 | + # Show relevant lines from the deletion log |
118 | 118 | $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" ); |
119 | 119 | LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText() ); |
120 | | - if( $wgUser->isAllowed( 'suppressionlog' ) ){ |
| 120 | + # Show relevant lines from the suppression log |
| 121 | + if( $wgUser->isAllowed( 'suppressionlog' ) ) { |
121 | 122 | $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" ); |
122 | 123 | LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText() ); |
123 | 124 | } |
— | — | @@ -155,7 +156,8 @@ |
156 | 157 | array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER ) |
157 | 158 | ); |
158 | 159 | if( $wgUser->isAllowed('suppressrevision') ) { |
159 | | - $this->checks[] = array( 'revdelete-hide-restricted', 'wpHideRestricted', Revision::DELETED_RESTRICTED ); |
| 160 | + $this->checks[] = array( 'revdelete-hide-restricted', |
| 161 | + 'wpHideRestricted', Revision::DELETED_RESTRICTED ); |
160 | 162 | } |
161 | 163 | } |
162 | 164 | |
— | — | @@ -292,15 +294,14 @@ |
293 | 295 | Xml::hidden( 'type', $this->deleteKey ) |
294 | 296 | ); |
295 | 297 | if( $this->deleteKey=='oldid' ) { |
296 | | - foreach( $revObjs as $rev ) |
297 | | - $hidden[] = Xml::hidden( 'oldid[]', $rev->getId() ); |
| 298 | + $hidden[] = Xml::hidden( 'oldid', implode(',',$this->oldids) ); |
298 | 299 | } else { |
299 | | - foreach( $revObjs as $rev ) |
300 | | - $hidden[] = Xml::hidden( 'artimestamp[]', $rev->getTimestamp() ); |
| 300 | + $hidden[] = Xml::hidden( 'artimestamp', implode(',',$this->artimestamps) ); |
301 | 301 | } |
302 | 302 | $special = SpecialPage::getTitleFor( 'Revisiondelete' ); |
303 | 303 | $wgOut->addHTML( |
304 | | - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $special->getLocalUrl( 'action=submit' ), |
| 304 | + Xml::openElement( 'form', array( 'method' => 'post', |
| 305 | + 'action' => $special->getLocalUrl( 'action=submit' ), |
305 | 306 | 'id' => 'mw-revdel-form-revisions' ) ) . |
306 | 307 | Xml::openElement( 'fieldset' ) . |
307 | 308 | xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) |
— | — | @@ -423,16 +424,16 @@ |
424 | 425 | Xml::hidden( 'type', $this->deleteKey ) |
425 | 426 | ); |
426 | 427 | if( $this->deleteKey=='oldimage' ) { |
427 | | - foreach( $this->ofiles as $filename ) |
428 | | - $hidden[] = Xml::hidden( 'oldimage[]', $filename ); |
| 428 | + $hidden[] = Xml::hidden( 'oldimage', implode(',',$this->oldimgs) ); |
429 | 429 | } else { |
430 | | - foreach( $this->afiles as $fileid ) |
431 | | - $hidden[] = Xml::hidden( 'fileid[]', $fileid ); |
| 430 | + $hidden[] = Xml::hidden( 'fileid', implode(',',$this->fileids) ); |
432 | 431 | } |
433 | 432 | $special = SpecialPage::getTitleFor( 'Revisiondelete' ); |
434 | 433 | $wgOut->addHTML( |
435 | | - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $special->getLocalUrl( 'action=submit' ), |
436 | | - 'id' => 'mw-revdel-form-filerevisions' ) ) . |
| 434 | + Xml::openElement( 'form', array( 'method' => 'post', |
| 435 | + 'action' => $special->getLocalUrl( 'action=submit' ), |
| 436 | + 'id' => 'mw-revdel-form-filerevisions' ) |
| 437 | + ) . |
437 | 438 | Xml::fieldset( wfMsg( 'revdelete-legend' ) ) |
438 | 439 | ); |
439 | 440 | |
— | — | @@ -512,15 +513,14 @@ |
513 | 514 | $hidden = array( |
514 | 515 | Xml::hidden( 'wpEditToken', $wgUser->editToken() ), |
515 | 516 | Xml::hidden( 'target', $this->page->getPrefixedText() ), |
516 | | - Xml::hidden( 'type', $this->deleteKey ) ); |
517 | | - foreach( $this->events as $logid ) { |
518 | | - $hidden[] = Xml::hidden( 'logid[]', $logid ); |
519 | | - } |
| 517 | + Xml::hidden( 'type', $this->deleteKey ), |
| 518 | + Xml::hidden( 'logid', implode(',',$this->logids) ) |
| 519 | + ); |
520 | 520 | |
521 | 521 | $special = SpecialPage::getTitleFor( 'Revisiondelete' ); |
522 | 522 | $wgOut->addHTML( |
523 | | - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $special->getLocalUrl( 'action=submit' ), |
524 | | - 'id' => 'mw-revdel-form-logs' ) ) . |
| 523 | + Xml::openElement( 'form', array( 'method' => 'post', |
| 524 | + 'action' => $special->getLocalUrl( 'action=submit' ), 'id' => 'mw-revdel-form-logs' ) ) . |
525 | 525 | Xml::fieldset( wfMsg( 'revdelete-legend' ) ) |
526 | 526 | ); |
527 | 527 | |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -1139,10 +1139,11 @@ |
1140 | 1140 | if( $wgUser->isAllowed( 'deleterevision' ) ) { |
1141 | 1141 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
1142 | 1142 | // If revision was hidden from sysops |
1143 | | - $revdlink = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.wfMsgHtml('rev-delundel').')' ); |
| 1143 | + $revdlink = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
| 1144 | + '('.wfMsgHtml('rev-delundel').')' ); |
1144 | 1145 | } else { |
1145 | 1146 | $query = array( 'target' => $this->mTargetObj->getPrefixedUrl(), |
1146 | | - 'artimestamp[]' => $ts |
| 1147 | + 'artimestamp' => $ts |
1147 | 1148 | ); |
1148 | 1149 | $revdlink = $sk->revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
1149 | 1150 | } |