Merge "Update type of PermissionManager::resultToError"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 18 Jun 2019 19:38:39 +0000 (19:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 18 Jun 2019 19:38:39 +0000 (19:38 +0000)
1  2 
includes/Title.php

diff --combined includes/Title.php
@@@ -1979,7 -1979,7 +1979,7 @@@ class Title implements LinkTarget, IDBA
         *
         * @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
         * 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
         */
  
                # 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" );
                        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 == '';