Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / includes / cache / HTMLFileCache.php
index 033941f..483eaa5 100644 (file)
@@ -48,6 +48,7 @@ class HTMLFileCache extends FileCacheBase {
         * @throws MWException
         */
        public function __construct( $title, $action ) {
+               parent::__construct();
                $allowedTypes = self::cacheablePageActions();
                if ( !in_array( $action, $allowedTypes ) ) {
                        throw new MWException( 'Invalid file cache type given.' );
@@ -127,7 +128,11 @@ class HTMLFileCache extends FileCacheBase {
                $clang = $wgContLang->getCode();
 
                // Check that there are no other sources of variation
-               return !$user->getId() && !$user->getNewtalk() && $ulang == $clang;
+               if ( $user->getId() || $user->getNewtalk() || $ulang != $clang ) {
+                       return false;
+               }
+               // Allow extensions to disable caching
+               return Hooks::run( 'HTMLFileCache::useFileCache', array( $context ) );
        }
 
        /**