Made prepareContentForEdit() use the stash cache by default
[lhc/web/wiklou.git] / includes / Title.php
index b97d36a..638da08 100644 (file)
@@ -503,7 +503,7 @@ class Title {
                }
 
                $t = new Title();
-               $t->mDbkeyform = Title::makeName( $ns, $title, $fragment, $interwiki );
+               $t->mDbkeyform = Title::makeName( $ns, $title, $fragment, $interwiki, true );
                if ( $t->secureAndSplit() ) {
                        return $t;
                } else {
@@ -747,12 +747,20 @@ class Title {
         * @param string $title The DB key form the title
         * @param string $fragment The link fragment (after the "#")
         * @param string $interwiki The interwiki prefix
+        * @param boolean $canoncialNamespace If true, use the canonical name for
+        *   $ns instead of the localized version.
         * @return string The prefixed form of the title
         */
-       public static function makeName( $ns, $title, $fragment = '', $interwiki = '' ) {
+       public static function makeName( $ns, $title, $fragment = '', $interwiki = '',
+               $canoncialNamespace = false
+       ) {
                global $wgContLang;
 
-               $namespace = $wgContLang->getNsText( $ns );
+               if ( $canoncialNamespace ) {
+                       $namespace = MWNamespace::getCanonicalName( $ns );
+               } else {
+                       $namespace = $wgContLang->getNsText( $ns );
+               }
                $name = $namespace == '' ? $title : "$namespace:$title";
                if ( strval( $interwiki ) != '' ) {
                        $name = "$interwiki:$name";
@@ -1242,9 +1250,9 @@ class Title {
 
                # @note This hook is also called in ContentHandler::getDefaultModel.
                #   It's called here again to make sure hook functions can force this
-               #   method to return true even outside the mediawiki namespace.
+               #   method to return true even outside the MediaWiki namespace.
 
-               wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage ) );
+               wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage ), '1.25' );
 
                return $isCssOrJsPage;
        }