Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -109,7 +109,10 @@ |
110 | 110 | function listRevisions() { |
111 | 111 | $dbr = wfGetDB( DB_SLAVE ); |
112 | 112 | $res = $dbr->select( 'archive', |
113 | | - array( 'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text', 'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id' ), |
| 113 | + array( |
| 114 | + 'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text', |
| 115 | + 'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id' |
| 116 | + ), |
114 | 117 | array( 'ar_namespace' => $this->title->getNamespace(), |
115 | 118 | 'ar_title' => $this->title->getDBkey() ), |
116 | 119 | 'PageArchive::listRevisions', |
— | — | @@ -254,7 +257,7 @@ |
255 | 258 | if( is_null( $row->ar_text_id ) ) { |
256 | 259 | // An old row from MediaWiki 1.4 or previous. |
257 | 260 | // Text is embedded in this row in classic compression format. |
258 | | - return Revision::getRevisionText( $row, "ar_" ); |
| 261 | + return Revision::getRevisionText( $row, 'ar_' ); |
259 | 262 | } else { |
260 | 263 | // New-style: keyed to the text storage backend. |
261 | 264 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -266,7 +269,6 @@ |
267 | 270 | } |
268 | 271 | } |
269 | 272 | |
270 | | - |
271 | 273 | /** |
272 | 274 | * Fetch (and decompress if necessary) the stored text of the most |
273 | 275 | * recently edited deleted revision of the page. |
— | — | @@ -300,7 +302,7 @@ |
301 | 303 | $n = $dbr->selectField( 'archive', 'COUNT(ar_title)', |
302 | 304 | array( 'ar_namespace' => $this->title->getNamespace(), |
303 | 305 | 'ar_title' => $this->title->getDBkey() ) ); |
304 | | - return ($n > 0); |
| 306 | + return ( $n > 0 ); |
305 | 307 | } |
306 | 308 | |
307 | 309 | /** |
— | — | @@ -363,11 +365,12 @@ |
364 | 366 | return false; |
365 | 367 | } |
366 | 368 | |
367 | | - if( trim( $comment ) != '' ) |
| 369 | + if( trim( $comment ) != '' ) { |
368 | 370 | $reason .= wfMsgForContent( 'colon-separator' ) . $comment; |
| 371 | + } |
369 | 372 | $log->addEntry( 'restore', $this->title, $reason ); |
370 | 373 | |
371 | | - return array($textRestored, $filesRestored, $reason); |
| 374 | + return array( $textRestored, $filesRestored, $reason ); |
372 | 375 | } |
373 | 376 | |
374 | 377 | /** |
— | — | @@ -382,8 +385,9 @@ |
383 | 386 | * @return Mixed: number of revisions restored or false on failure |
384 | 387 | */ |
385 | 388 | private function undeleteRevisions( $timestamps, $unsuppress = false, $comment = '' ) { |
386 | | - if ( wfReadOnly() ) |
| 389 | + if ( wfReadOnly() ) { |
387 | 390 | return false; |
| 391 | + } |
388 | 392 | $restoreAll = empty( $timestamps ); |
389 | 393 | |
390 | 394 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -458,7 +462,7 @@ |
459 | 463 | $ret = $dbw->resultObject( $result ); |
460 | 464 | $rev_count = $dbw->numRows( $result ); |
461 | 465 | if( !$rev_count ) { |
462 | | - wfDebug( __METHOD__.": no revisions to restore\n" ); |
| 466 | + wfDebug( __METHOD__ . ": no revisions to restore\n" ); |
463 | 467 | return false; // ??? |
464 | 468 | } |
465 | 469 | |
— | — | @@ -468,7 +472,7 @@ |
469 | 473 | |
470 | 474 | if( $makepage ) { |
471 | 475 | // Check the state of the newest to-be version... |
472 | | - if( !$unsuppress && ($row->ar_deleted & Revision::DELETED_TEXT) ) { |
| 476 | + if( !$unsuppress && ( $row->ar_deleted & Revision::DELETED_TEXT ) ) { |
473 | 477 | return false; // we can't leave the current revision like this! |
474 | 478 | } |
475 | 479 | // Safe to insert now... |
— | — | @@ -478,7 +482,7 @@ |
479 | 483 | // Check if a deleted revision will become the current revision... |
480 | 484 | if( $row->ar_timestamp > $previousTimestamp ) { |
481 | 485 | // Check the state of the newest to-be version... |
482 | | - if( !$unsuppress && ($row->ar_deleted & Revision::DELETED_TEXT) ) { |
| 486 | + if( !$unsuppress && ( $row->ar_deleted & Revision::DELETED_TEXT ) ) { |
483 | 487 | return false; // we can't leave the current revision like this! |
484 | 488 | } |
485 | 489 | } |
— | — | @@ -490,8 +494,11 @@ |
491 | 495 | foreach ( $ret as $row ) { |
492 | 496 | // Check for key dupes due to shitty archive integrity. |
493 | 497 | if( $row->ar_rev_id ) { |
494 | | - $exists = $dbw->selectField( 'revision', '1', array('rev_id' => $row->ar_rev_id), __METHOD__ ); |
495 | | - if( $exists ) continue; // don't throw DB errors |
| 498 | + $exists = $dbw->selectField( 'revision', '1', |
| 499 | + array( 'rev_id' => $row->ar_rev_id ), __METHOD__ ); |
| 500 | + if( $exists ) { |
| 501 | + continue; // don't throw DB errors |
| 502 | + } |
496 | 503 | } |
497 | 504 | // Insert one revision at a time...maintaining deletion status |
498 | 505 | // unless we are specifically removing all restrictions... |
— | — | @@ -594,7 +601,7 @@ |
595 | 602 | } elseif ( $wgUser->isAllowed( 'deletedtext' ) ) { |
596 | 603 | $this->mAllowed = false; // user cannot restore |
597 | 604 | $this->mCanView = true; // user can view content |
598 | | - } else { // user can only view the list of revisions |
| 605 | + } else { // user can only view the list of revisions |
599 | 606 | $this->mAllowed = false; |
600 | 607 | $this->mCanView = false; |
601 | 608 | $this->mTimestamp = ''; |
— | — | @@ -632,9 +639,9 @@ |
633 | 640 | $this->loadRequest(); |
634 | 641 | |
635 | 642 | if ( $this->mAllowed ) { |
636 | | - $wgOut->setPagetitle( wfMsg( "undeletepage" ) ); |
| 643 | + $wgOut->setPageTitle( wfMsg( 'undeletepage' ) ); |
637 | 644 | } else { |
638 | | - $wgOut->setPagetitle( wfMsg( "viewdeletedpage" ) ); |
| 645 | + $wgOut->setPageTitle( wfMsg( 'viewdeletedpage' ) ); |
639 | 646 | } |
640 | 647 | |
641 | 648 | if( $par != '' ) { |
— | — | @@ -648,7 +655,7 @@ |
649 | 656 | } |
650 | 657 | |
651 | 658 | if( is_null( $this->mTargetObj ) ) { |
652 | | - # Not all users can just browse every deleted page from the list |
| 659 | + # Not all users can just browse every deleted page from the list |
653 | 660 | if( $wgUser->isAllowed( 'browsearchive' ) ) { |
654 | 661 | $this->showSearchForm(); |
655 | 662 | |
— | — | @@ -685,7 +692,7 @@ |
686 | 693 | return $this->showFile( $this->mFile ); |
687 | 694 | } |
688 | 695 | } |
689 | | - if( $this->mRestore && $this->mAction == "submit" ) { |
| 696 | + if( $this->mRestore && $this->mAction == 'submit' ) { |
690 | 697 | global $wgUploadMaintenance; |
691 | 698 | if( $wgUploadMaintenance && $this->mTargetObj && $this->mTargetObj->getNamespace() == NS_FILE ) { |
692 | 699 | $wgOut->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n", array( 'filedelete-maintenance' ) ); |
— | — | @@ -693,8 +700,8 @@ |
694 | 701 | } |
695 | 702 | return $this->undelete(); |
696 | 703 | } |
697 | | - if( $this->mInvert && $this->mAction == "submit" ) { |
698 | | - return $this->showHistory( ); |
| 704 | + if( $this->mInvert && $this->mAction == 'submit' ) { |
| 705 | + return $this->showHistory(); |
699 | 706 | } |
700 | 707 | return $this->showHistory(); |
701 | 708 | } |
— | — | @@ -757,7 +764,9 @@ |
758 | 765 | |
759 | 766 | $skin = $wgUser->getSkin(); |
760 | 767 | |
761 | | - if(!preg_match("/[0-9]{14}/",$timestamp)) return 0; |
| 768 | + if( !preg_match( '/[0-9]{14}/', $timestamp ) ) { |
| 769 | + return 0; |
| 770 | + } |
762 | 771 | |
763 | 772 | $archive = new PageArchive( $this->mTargetObj ); |
764 | 773 | $rev = $archive->getRevision( $timestamp ); |
— | — | @@ -767,8 +776,8 @@ |
768 | 777 | return; |
769 | 778 | } |
770 | 779 | |
771 | | - if( $rev->isDeleted(Revision::DELETED_TEXT) ) { |
772 | | - if( !$rev->userCan(Revision::DELETED_TEXT) ) { |
| 780 | + if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { |
| 781 | + if( !$rev->userCan( Revision::DELETED_TEXT ) ) { |
773 | 782 | $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", 'rev-deleted-text-permission' ); |
774 | 783 | return; |
775 | 784 | } else { |
— | — | @@ -826,7 +835,7 @@ |
827 | 836 | wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) ); |
828 | 837 | |
829 | 838 | if( $this->mPreview ) { |
830 | | - //Hide [edit]s |
| 839 | + // Hide [edit]s |
831 | 840 | $popts = $wgOut->parserOptions(); |
832 | 841 | $popts->setEditSection( false ); |
833 | 842 | $wgOut->parserOptions( $popts ); |
— | — | @@ -881,7 +890,7 @@ |
882 | 891 | function revDeleteLink( $rev ) { |
883 | 892 | global $wgUser; |
884 | 893 | $canHide = $wgUser->isAllowed( 'deleterevision' ); |
885 | | - if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' )) ) { |
| 894 | + if( $canHide || ( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) ) { |
886 | 895 | $skin = $wgUser->getSkin(); |
887 | 896 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
888 | 897 | $revdlink = $skin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
— | — | @@ -948,7 +957,7 @@ |
949 | 958 | |
950 | 959 | /** |
951 | 960 | * @param $rev Revision |
952 | | - * @param $prefix |
| 961 | + * @param $prefix |
953 | 962 | * @return string |
954 | 963 | */ |
955 | 964 | private function diffHeader( $rev, $prefix ) { |
— | — | @@ -970,7 +979,7 @@ |
971 | 980 | // Add show/hide deletion links if available |
972 | 981 | $del .= $this->revDeleteLink( $rev ); |
973 | 982 | return |
974 | | - '<div id="mw-diff-'.$prefix.'title1"><strong>' . |
| 983 | + '<div id="mw-diff-' . $prefix . 'title1"><strong>' . |
975 | 984 | $sk->link( |
976 | 985 | $targetPage, |
977 | 986 | wfMsgHtml( |
— | — | @@ -1004,7 +1013,7 @@ |
1005 | 1014 | $wgOut->addHTML( |
1006 | 1015 | Xml::openElement( 'form', array( |
1007 | 1016 | 'method' => 'POST', |
1008 | | - 'action' => $this->getTitle()->getLocalUrl( |
| 1017 | + 'action' => $this->getTitle()->getLocalURL( |
1009 | 1018 | 'target=' . urlencode( $this->mTarget ) . |
1010 | 1019 | '&file=' . urlencode( $key ) . |
1011 | 1020 | '&token=' . urlencode( $wgUser->editToken( $key ) ) ) |
— | — | @@ -1037,32 +1046,35 @@ |
1038 | 1047 | wfStreamFile( $path ); |
1039 | 1048 | } |
1040 | 1049 | |
1041 | | - private function showHistory( ) { |
| 1050 | + private function showHistory() { |
1042 | 1051 | global $wgUser, $wgOut; |
1043 | 1052 | |
1044 | 1053 | $sk = $wgUser->getSkin(); |
1045 | 1054 | if( $this->mAllowed ) { |
1046 | | - $wgOut->setPagetitle( wfMsg( "undeletepage" ) ); |
| 1055 | + $wgOut->setPageTitle( wfMsg( 'undeletepage' ) ); |
1047 | 1056 | } else { |
1048 | | - $wgOut->setPagetitle( wfMsg( 'viewdeletedpage' ) ); |
| 1057 | + $wgOut->setPageTitle( wfMsg( 'viewdeletedpage' ) ); |
1049 | 1058 | } |
1050 | 1059 | |
1051 | | - $wgOut->wrapWikiMsg( "<div class='mw-undelete-pagetitle'>\n$1\n</div>\n", array ( 'undeletepagetitle', $this->mTargetObj->getPrefixedText() ) ); |
| 1060 | + $wgOut->wrapWikiMsg( |
| 1061 | + "<div class='mw-undelete-pagetitle'>\n$1\n</div>\n", |
| 1062 | + array( 'undeletepagetitle', $this->mTargetObj->getPrefixedText() ) |
| 1063 | + ); |
1052 | 1064 | |
1053 | 1065 | $archive = new PageArchive( $this->mTargetObj ); |
1054 | 1066 | /* |
1055 | 1067 | $text = $archive->getLastRevisionText(); |
1056 | 1068 | if( is_null( $text ) ) { |
1057 | | - $wgOut->addWikiMsg( "nohistory" ); |
| 1069 | + $wgOut->addWikiMsg( 'nohistory' ); |
1058 | 1070 | return; |
1059 | 1071 | } |
1060 | 1072 | */ |
1061 | 1073 | $wgOut->addHTML( '<div class="mw-undelete-history">' ); |
1062 | 1074 | if ( $this->mAllowed ) { |
1063 | | - $wgOut->addWikiMsg( "undeletehistory" ); |
1064 | | - $wgOut->addWikiMsg( "undeleterevdel" ); |
| 1075 | + $wgOut->addWikiMsg( 'undeletehistory' ); |
| 1076 | + $wgOut->addWikiMsg( 'undeleterevdel' ); |
1065 | 1077 | } else { |
1066 | | - $wgOut->addWikiMsg( "undeletehistorynoadmin" ); |
| 1078 | + $wgOut->addWikiMsg( 'undeletehistorynoadmin' ); |
1067 | 1079 | } |
1068 | 1080 | $wgOut->addHTML( '</div>' ); |
1069 | 1081 | |
— | — | @@ -1117,12 +1129,12 @@ |
1118 | 1130 | "<tr> |
1119 | 1131 | <td> </td> |
1120 | 1132 | <td class='mw-input'>" . |
1121 | | - Xml::checkLabel( wfMsg('revdelete-unsuppress'), 'wpUnsuppress', |
| 1133 | + Xml::checkLabel( wfMsg( 'revdelete-unsuppress' ), 'wpUnsuppress', |
1122 | 1134 | 'mw-undelete-unsuppress', $this->mUnsuppress ). |
1123 | 1135 | "</td> |
1124 | 1136 | </tr>"; |
1125 | 1137 | } else { |
1126 | | - $unsuppressBox = ""; |
| 1138 | + $unsuppressBox = ''; |
1127 | 1139 | } |
1128 | 1140 | $table = |
1129 | 1141 | Xml::fieldset( wfMsg( 'undelete-fieldset-title' ) ) . |
— | — | @@ -1159,7 +1171,7 @@ |
1160 | 1172 | |
1161 | 1173 | if( $haveRevisions ) { |
1162 | 1174 | # The page's stored (deleted) history: |
1163 | | - $wgOut->addHTML("<ul>"); |
| 1175 | + $wgOut->addHTML( '<ul>' ); |
1164 | 1176 | $remaining = $revisions->numRows(); |
1165 | 1177 | $earliestLiveTime = $this->mTargetObj->getEarliestRevTime(); |
1166 | 1178 | |
— | — | @@ -1168,19 +1180,19 @@ |
1169 | 1181 | $wgOut->addHTML( $this->formatRevisionRow( $row, $earliestLiveTime, $remaining, $sk ) ); |
1170 | 1182 | } |
1171 | 1183 | $revisions->free(); |
1172 | | - $wgOut->addHTML("</ul>"); |
| 1184 | + $wgOut->addHTML( '</ul>' ); |
1173 | 1185 | } else { |
1174 | | - $wgOut->addWikiMsg( "nohistory" ); |
| 1186 | + $wgOut->addWikiMsg( 'nohistory' ); |
1175 | 1187 | } |
1176 | 1188 | |
1177 | 1189 | if( $haveFiles ) { |
1178 | 1190 | $wgOut->addHTML( Xml::element( 'h2', null, wfMsg( 'filehist' ) ) . "\n" ); |
1179 | | - $wgOut->addHTML( "<ul>" ); |
| 1191 | + $wgOut->addHTML( '<ul>' ); |
1180 | 1192 | foreach ( $files as $row ) { |
1181 | 1193 | $wgOut->addHTML( $this->formatFileRow( $row, $sk ) ); |
1182 | 1194 | } |
1183 | 1195 | $files->free(); |
1184 | | - $wgOut->addHTML( "</ul>" ); |
| 1196 | + $wgOut->addHTML( '</ul>' ); |
1185 | 1197 | } |
1186 | 1198 | |
1187 | 1199 | if ( $this->mAllowed ) { |
— | — | @@ -1205,7 +1217,7 @@ |
1206 | 1218 | if( $this->mAllowed ) { |
1207 | 1219 | if( $this->mInvert ) { |
1208 | 1220 | if( in_array( $ts, $this->mTargetTimestamp ) ) { |
1209 | | - $checkBox = Xml::check( "ts$ts"); |
| 1221 | + $checkBox = Xml::check( "ts$ts" ); |
1210 | 1222 | } else { |
1211 | 1223 | $checkBox = Xml::check( "ts$ts", true ); |
1212 | 1224 | } |
— | — | @@ -1221,12 +1233,12 @@ |
1222 | 1234 | # Last link |
1223 | 1235 | if( !$rev->userCan( Revision::DELETED_TEXT ) ) { |
1224 | 1236 | $pageLink = htmlspecialchars( $wgLang->timeanddate( $ts, true ) ); |
1225 | | - $last = wfMsgHtml('diff'); |
1226 | | - } else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) { |
| 1237 | + $last = wfMsgHtml( 'diff' ); |
| 1238 | + } else if( $remaining > 0 || ( $earliestLiveTime && $ts > $earliestLiveTime ) ) { |
1227 | 1239 | $pageLink = $this->getPageLink( $rev, $titleObj, $ts, $sk ); |
1228 | 1240 | $last = $sk->linkKnown( |
1229 | 1241 | $titleObj, |
1230 | | - wfMsgHtml('diff'), |
| 1242 | + wfMsgHtml( 'diff' ), |
1231 | 1243 | array(), |
1232 | 1244 | array( |
1233 | 1245 | 'target' => $this->mTargetObj->getPrefixedText(), |
— | — | @@ -1236,16 +1248,17 @@ |
1237 | 1249 | ); |
1238 | 1250 | } else { |
1239 | 1251 | $pageLink = $this->getPageLink( $rev, $titleObj, $ts, $sk ); |
1240 | | - $last = wfMsgHtml('diff'); |
| 1252 | + $last = wfMsgHtml( 'diff' ); |
1241 | 1253 | } |
1242 | 1254 | } else { |
1243 | 1255 | $pageLink = htmlspecialchars( $wgLang->timeanddate( $ts, true ) ); |
1244 | | - $last = wfMsgHtml('diff'); |
| 1256 | + $last = wfMsgHtml( 'diff' ); |
1245 | 1257 | } |
1246 | 1258 | // User links |
1247 | 1259 | $userLink = $sk->revUserTools( $rev ); |
1248 | 1260 | // Revision text size |
1249 | | - if( !is_null($size = $row->ar_len) ) { |
| 1261 | + $size = $row->ar_len; |
| 1262 | + if( !is_null( $size ) ) { |
1250 | 1263 | $stxt = $sk->formatRevisionSize( $size ); |
1251 | 1264 | } |
1252 | 1265 | // Edit summary |
— | — | @@ -1262,7 +1275,7 @@ |
1263 | 1276 | |
1264 | 1277 | $ts = wfTimestamp( TS_MW, $row->fa_timestamp ); |
1265 | 1278 | if( $this->mAllowed && $row->fa_storage_key ) { |
1266 | | - $checkBox = Xml::check( "fileid" . $row->fa_id ); |
| 1279 | + $checkBox = Xml::check( 'fileid' . $row->fa_id ); |
1267 | 1280 | $key = urlencode( $row->fa_storage_key ); |
1268 | 1281 | $pageLink = $this->getFileLink( $file, $this->getTitle(), $ts, $key, $sk ); |
1269 | 1282 | } else { |
— | — | @@ -1323,8 +1336,9 @@ |
1324 | 1337 | 'timestamp' => $ts |
1325 | 1338 | ) |
1326 | 1339 | ); |
1327 | | - if( $rev->isDeleted(Revision::DELETED_TEXT) ) |
| 1340 | + if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { |
1328 | 1341 | $link = '<span class="history-deleted">' . $link . '</span>'; |
| 1342 | + } |
1329 | 1343 | return $link; |
1330 | 1344 | } |
1331 | 1345 | } |
— | — | @@ -1352,8 +1366,9 @@ |
1353 | 1367 | 'token' => $wgUser->editToken( $key ) |
1354 | 1368 | ) |
1355 | 1369 | ); |
1356 | | - if( $file->isDeleted(File::DELETED_FILE) ) |
| 1370 | + if( $file->isDeleted( File::DELETED_FILE ) ) { |
1357 | 1371 | $link = '<span class="history-deleted">' . $link . '</span>'; |
| 1372 | + } |
1358 | 1373 | return $link; |
1359 | 1374 | } |
1360 | 1375 | } |
— | — | @@ -1371,8 +1386,9 @@ |
1372 | 1387 | } else { |
1373 | 1388 | $link = $sk->userLink( $file->getRawUser(), $file->getRawUserText() ) . |
1374 | 1389 | $sk->userToolLinks( $file->getRawUser(), $file->getRawUserText() ); |
1375 | | - if( $file->isDeleted( File::DELETED_USER ) ) |
| 1390 | + if( $file->isDeleted( File::DELETED_USER ) ) { |
1376 | 1391 | $link = '<span class="history-deleted">' . $link . '</span>'; |
| 1392 | + } |
1377 | 1393 | return $link; |
1378 | 1394 | } |
1379 | 1395 | } |
— | — | @@ -1386,11 +1402,13 @@ |
1387 | 1403 | */ |
1388 | 1404 | function getFileComment( $file, $sk ) { |
1389 | 1405 | if( !$file->userCan( File::DELETED_COMMENT ) ) { |
1390 | | - return '<span class="history-deleted"><span class="comment">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span></span>'; |
| 1406 | + return '<span class="history-deleted"><span class="comment">' . |
| 1407 | + wfMsgHtml( 'rev-deleted-comment' ) . '</span></span>'; |
1391 | 1408 | } else { |
1392 | 1409 | $link = $sk->commentBlock( $file->getRawDescription() ); |
1393 | | - if( $file->isDeleted(File::DELETED_COMMENT) ) |
| 1410 | + if( $file->isDeleted( File::DELETED_COMMENT ) ) { |
1394 | 1411 | $link = '<span class="history-deleted">' . $link . '</span>'; |
| 1412 | + } |
1395 | 1413 | return $link; |
1396 | 1414 | } |
1397 | 1415 | } |
— | — | @@ -1409,17 +1427,18 @@ |
1410 | 1428 | $this->mFileVersions, |
1411 | 1429 | $this->mUnsuppress ); |
1412 | 1430 | |
1413 | | - if( is_array($ok) ) { |
1414 | | - if ( $ok[1] ) // Undeleted file count |
| 1431 | + if( is_array( $ok ) ) { |
| 1432 | + if ( $ok[1] ) { // Undeleted file count |
1415 | 1433 | wfRunHooks( 'FileUndeleteComplete', array( |
1416 | 1434 | $this->mTargetObj, $this->mFileVersions, |
1417 | | - $wgUser, $this->mComment) ); |
| 1435 | + $wgUser, $this->mComment ) ); |
| 1436 | + } |
1418 | 1437 | |
1419 | 1438 | $skin = $wgUser->getSkin(); |
1420 | 1439 | $link = $skin->linkKnown( $this->mTargetObj ); |
1421 | 1440 | $wgOut->addWikiMsgArray( 'undeletedpage', array( $link ), array( 'replaceafter' ) ); |
1422 | 1441 | } else { |
1423 | | - $wgOut->showFatalError( wfMsg( "cannotundelete" ) ); |
| 1442 | + $wgOut->showFatalError( wfMsg( 'cannotundelete' ) ); |
1424 | 1443 | $wgOut->addWikiMsg( 'undeleterevdel' ); |
1425 | 1444 | } |
1426 | 1445 | |
— | — | @@ -1429,7 +1448,7 @@ |
1430 | 1449 | $wgOut->addWikiText( $status->getWikiText( 'undelete-error-short', 'undelete-error-long' ) ); |
1431 | 1450 | } |
1432 | 1451 | } else { |
1433 | | - $wgOut->showFatalError( wfMsg( "cannotundelete" ) ); |
| 1452 | + $wgOut->showFatalError( wfMsg( 'cannotundelete' ) ); |
1434 | 1453 | } |
1435 | 1454 | return false; |
1436 | 1455 | } |