X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2FTitle.php;h=f69f1a4503b674f1b9ba1b55cd971fe93c07b7f1;hb=cd96adf65fd2aca3c31535ad562948e768fb6131;hp=3d262d51fc1eb912decbf6139ae6f11e4ed30a93;hpb=f01c8c59fd6387aac1e331fe4ba23604e7e94737;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 3d262d51fc..f69f1a4503 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1979,7 +1979,7 @@ class Title implements LinkTarget, IDBAccessObject { * * @param string|string[] $query An optional query string, * not used for interwiki links. Can be specified as an associative array as well, - * e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped). + * e.g., [ 'action' => 'edit' ] (keys and values will be URL-escaped). * Some query patterns will trigger various shorturl path replacements. * @param string|string[]|bool $query2 An optional secondary query array. This one MUST * be an array. If a string is passed it will be interpreted as a deprecated @@ -2235,7 +2235,7 @@ class Title implements LinkTarget, IDBAccessObject { * @throws Exception * * @deprecated since 1.33, - * use MediaWikiServices::getInstance()->getPermissionManager()->getUserPermissionsErrors() + * use MediaWikiServices::getInstance()->getPermissionManager()->getPermissionErrors() * */ public function getUserPermissionsErrors( @@ -2256,7 +2256,7 @@ class Title implements LinkTarget, IDBAccessObject { * Add the resulting error code to the errors array * * @param array $errors List of current errors - * @param array $result Result of errors + * @param array|string|MessageSpecifier|false $result Result of errors * * @return array List of errors */ @@ -3584,7 +3584,8 @@ class Title implements LinkTarget, IDBAccessObject { # Is it an existing file? if ( $nt->getNamespace() == NS_FILE ) { - $file = wfLocalFile( $nt ); + $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo() + ->newFile( $nt ); $file->load( File::READ_LATEST ); if ( $file->exists() ) { wfDebug( __METHOD__ . ": file exists\n" ); @@ -4056,15 +4057,15 @@ class Title implements LinkTarget, IDBAccessObject { return true; // any interwiki link might be viewable, for all we know } + $services = MediaWikiServices::getInstance(); switch ( $this->mNamespace ) { case NS_MEDIA: case NS_FILE: // file exists, possibly in a foreign repo - return (bool)wfFindFile( $this ); + return (bool)$services->getRepoGroup()->findFile( $this ); case NS_SPECIAL: // valid special page - return MediaWikiServices::getInstance()->getSpecialPageFactory()-> - exists( $this->mDbkeyform ); + return $services->getSpecialPageFactory()->exists( $this->mDbkeyform ); case NS_MAIN: // selflink, possibly with fragment return $this->mDbkeyform == '';