Merge "Add safemode to special redirect parameters that are preserved"
[lhc/web/wiklou.git] / includes / filerepo / FileRepo.php
index 3a366c8..cbbffe4 100644 (file)
@@ -121,13 +121,13 @@ class FileRepo {
        /** @var bool Whether all zones should be private (e.g. private wiki repo) */
        protected $isPrivate;
 
-       /** @var array callable Override these in the base class */
+       /** @var callable Override these in the base class */
        protected $fileFactory = [ UnregisteredLocalFile::class, 'newFromTitle' ];
-       /** @var array callable|bool Override these in the base class */
+       /** @var callable|false Override these in the base class */
        protected $oldFileFactory = false;
-       /** @var array callable|bool Override these in the base class */
+       /** @var callable|false Override these in the base class */
        protected $fileFactoryKey = false;
-       /** @var array callable|bool Override these in the base class */
+       /** @var callable|false Override these in the base class */
        protected $oldFileFactoryKey = false;
 
        /** @var string URL of where to proxy thumb.php requests to.
@@ -176,7 +176,8 @@ class FileRepo {
                }
 
                // Optional settings that have a default
-               $this->initialCapital = $info['initialCapital'] ?? MWNamespace::isCapitalized( NS_FILE );
+               $this->initialCapital = $info['initialCapital'] ??
+                       MediaWikiServices::getInstance()->getNamespaceInfo()->isCapitalized( NS_FILE );
                $this->url = $info['url'] ?? false; // a subclass may set the URL (e.g. ForeignAPIRepo)
                if ( isset( $info['thumbUrl'] ) ) {
                        $this->thumbUrl = $info['thumbUrl'];
@@ -229,7 +230,7 @@ class FileRepo {
        /**
         * Check if a single zone or list of zones is defined for usage
         *
-        * @param array $doZones Only do a particular zones
+        * @param string[]|string $doZones Only do a particular zones
         * @throws MWException
         * @return Status
         */
@@ -645,7 +646,10 @@ class FileRepo {
         * @return string
         */
        public function getNameFromTitle( Title $title ) {
-               if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) {
+               if (
+                       $this->initialCapital !=
+                       MediaWikiServices::getInstance()->getNamespaceInfo()->isCapitalized( NS_FILE )
+               ) {
                        $name = $title->getUserCaseDBKey();
                        if ( $this->initialCapital ) {
                                $name = MediaWikiServices::getInstance()->getContentLanguage()->ucfirst( $name );
@@ -730,7 +734,7 @@ class FileRepo {
        /**
         * Make an url to this repo
         *
-        * @param string $query Query string to append
+        * @param string|string[] $query Query string to append
         * @param string $entry Entry point; defaults to index
         * @return string|bool False on failure
         */
@@ -1685,7 +1689,7 @@ class FileRepo {
        /**
         * Get a callback function to use for cleaning error message parameters
         *
-        * @return string[]
+        * @return callable
         */
        function getErrorCleanupFunction() {
                switch ( $this->pathDisclosureProtection ) {
@@ -1735,7 +1739,7 @@ class FileRepo {
        /**
         * Create a new good result
         *
-        * @param null|string $value
+        * @param null|mixed $value
         * @return Status
         */
        public function newGood( $value = null ) {