Merge "Add .pipeline/ with dev image variant"
[lhc/web/wiklou.git] / includes / title / MediaWikiTitleCodec.php
index 7e7d85a..3ebb443 100644 (file)
@@ -62,7 +62,8 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
        protected $nsInfo;
 
        /**
-        * @param Language $language The language object to use for localizing namespace names.
+        * @param Language $language The language object to use for localizing namespace names,
+        *   capitalization, etc.
         * @param GenderCache $genderCache The gender cache for generating gendered namespace names
         * @param string[]|string $localInterwikis
         * @param InterwikiLookup|null $interwikiLookup
@@ -236,6 +237,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
         * @param LinkTarget $title
         *
         * @return string
+        * @suppress PhanUndeclaredProperty
         */
        public function getPrefixedText( LinkTarget $title ) {
                if ( !isset( $title->prefixedText ) ) {
@@ -467,8 +469,8 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
                # and [[Foo]] point to the same place.  Don't force it for interwikis, since the
                # other site might be case-sensitive.
                $parts['user_case_dbkey'] = $dbkey;
-               if ( $parts['interwiki'] === '' ) {
-                       $dbkey = Title::capitalize( $dbkey, $parts['namespace'] );
+               if ( $parts['interwiki'] === '' && $this->nsInfo->isCapitalized( $parts['namespace'] ) ) {
+                       $dbkey = $this->language->ucfirst( $dbkey );
                }
 
                # Can't make a link to a namespace alone... "empty" local links can only be