X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUndelete.php;h=1ea6e463e4d78fee5b857af1b576903946399244;hb=fe1d13368540b6d7d919e659565243d94d6c278c;hp=4c38a781ba72a622d44f3c961f61a294471adf65;hpb=5e2ac408f888043b3c62a42b5c9c9ece5ddaf419;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 4c38a781ba..1ea6e463e4 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -417,6 +417,9 @@ class PageArchive { $logEntry->setPerformer( $user ); $logEntry->setTarget( $this->title ); $logEntry->setComment( $reason ); + + wfRunHooks( 'ArticleUndeleteLogEntry', array( $this, &$logEntry, $user ) ); + $logid = $logEntry->insert(); $logEntry->publish( $logid ); @@ -429,9 +432,10 @@ class PageArchive { * be stuffed into old, otherwise the most recent will go into cur. * * @param $timestamps Array: pass an empty array to restore all revisions, otherwise list the ones to undelete. - * @param $comment String * @param $unsuppress Boolean: remove all ar_deleted/fa_deleted restrictions of seletected revs * + * @param $comment String + * @throws ReadOnlyError * @return Status, containing the number of revisions restored on success */ private function undeleteRevisions( $timestamps, $unsuppress = false, $comment = '' ) { @@ -575,6 +579,9 @@ class PageArchive { return Status::newFatal( "undeleterevdel" ); } } + + $newid = false; + $pageId = $article->getId(); } $revision = null; @@ -593,6 +600,7 @@ class PageArchive { // unless we are specifically removing all restrictions... $revision = Revision::newFromArchiveRow( $row, array( + 'page' => $pageId, 'title' => $this->title, 'deleted' => $unsuppress ? 0 : $row->ar_deleted ) ); @@ -819,7 +827,7 @@ class SpecialUndelete extends SpecialPage { if( $result->numRows() == 0 ) { $out->addWikiMsg( 'undelete-no-results' ); - return; + return false; } $out->addWikiMsg( 'undeletepagetext', $this->getLanguage()->formatNum( $result->numRows() ) );