X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fpage%2FPageArchive.php;h=d69a433d9ce8eb1bd47a8843256ebc7058797aea;hp=a314f3a9eaf879458ca9d4270f716712d739109b;hb=6cfb2e3d7a2b96d5041312fcec88248bb46573d7;hpb=632a82ec8e03ea701f257b96bc092d520385c47e diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php index a314f3a9ea..d69a433d9c 100644 --- a/includes/page/PageArchive.php +++ b/includes/page/PageArchive.php @@ -406,8 +406,8 @@ class PageArchive { * @param User|null $user User performing the action, or null to use $wgUser * @param string|string[]|null $tags Change tags to add to log entry * ($user should be able to add the specified tags before this is called) - * @return array|bool array(number of file revisions restored, number of image revisions - * restored, log message) on success, false on failure. + * @return array|bool [ number of file revisions restored, number of image revisions + * restored, log message ] on success, false on failure. */ public function undelete( $timestamps, $comment = '', $fileVersions = [], $unsuppress = false, User $user = null, $tags = null @@ -420,7 +420,9 @@ class PageArchive { $restoreFiles = $restoreAll || !empty( $fileVersions ); if ( $restoreFiles && $this->title->getNamespace() == NS_FILE ) { - $img = wfLocalFile( $this->title ); + /** @var LocalFile $img */ + $img = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo() + ->newFile( $this->title ); $img->load( File::READ_LATEST ); $this->fileStatus = $img->restore( $fileVersions, $unsuppress ); if ( !$this->fileStatus->isOK() ) {