X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FPageArchive.php;h=11e1a30db86dc260601a3671f1244e84909c17be;hb=6971569512b317a64612b102a7718f65269c5357;hp=188088f6aaf15559716a214b4913f7afbccf517e;hpb=86aead2fcc86342f8aebd3f7673d0b830f384db9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php index 188088f6aa..11e1a30db8 100644 --- a/includes/page/PageArchive.php +++ b/includes/page/PageArchive.php @@ -453,25 +453,12 @@ class PageArchive { // Touch the log! - if ( $textRestored && $filesRestored ) { - $reason = wfMessage( 'undeletedrevisions-files' ) - ->numParams( $textRestored, $filesRestored )->inContentLanguage()->text(); - } elseif ( $textRestored ) { - $reason = wfMessage( 'undeletedrevisions' )->numParams( $textRestored ) - ->inContentLanguage()->text(); - } elseif ( $filesRestored ) { - $reason = wfMessage( 'undeletedfiles' )->numParams( $filesRestored ) - ->inContentLanguage()->text(); - } else { + if ( !$textRestored && !$filesRestored ) { wfDebug( "Undelete: nothing undeleted...\n" ); return false; } - if ( trim( $comment ) != '' ) { - $reason .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment; - } - if ( $user === null ) { global $wgUser; $user = $wgUser; @@ -480,15 +467,21 @@ class PageArchive { $logEntry = new ManualLogEntry( 'delete', 'restore' ); $logEntry->setPerformer( $user ); $logEntry->setTarget( $this->title ); - $logEntry->setComment( $reason ); + $logEntry->setComment( $comment ); $logEntry->setTags( $tags ); + $logEntry->setParameters( [ + ':assoc:count' => [ + 'revisions' => $textRestored, + 'files' => $filesRestored, + ], + ] ); Hooks::run( 'ArticleUndeleteLogEntry', [ $this, &$logEntry, $user ] ); $logid = $logEntry->insert(); $logEntry->publish( $logid ); - return [ $textRestored, $filesRestored, $reason ]; + return [ $textRestored, $filesRestored, $comment ]; } /**