Merge "Segregate right to edit sitewide CSS/JS"
[lhc/web/wiklou.git] / includes / cache / HTMLFileCache.php
index b0a3a1c..f8cd754 100644 (file)
@@ -87,10 +87,11 @@ class HTMLFileCache extends FileCacheBase {
        /**
         * Check if pages can be cached for this request/user
         * @param IContextSource $context
-        * @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
+        * @param int $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
         * @return bool
         */
        public static function useFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
+               global $wgContLang;
                $config = MediaWikiServices::getInstance()->getMainConfig();
 
                if ( !$config->get( 'UseFileCache' ) && $mode !== self::MODE_REBUILD ) {
@@ -123,7 +124,7 @@ class HTMLFileCache extends FileCacheBase {
                $ulang = $context->getLanguage();
 
                // Check that there are no other sources of variation
-               if ( $user->getId() || $ulang->getCode() !== $config->get( 'LanguageCode' ) ) {
+               if ( $user->getId() || !$ulang->equals( $wgContLang ) ) {
                        return false;
                }
 
@@ -140,7 +141,7 @@ class HTMLFileCache extends FileCacheBase {
        /**
         * Read from cache to context output
         * @param IContextSource $context
-        * @param integer $mode One of the HTMLFileCache::MODE_* constants
+        * @param int $mode One of the HTMLFileCache::MODE_* constants
         * @return void
         */
        public function loadFromFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {