Enclose compact() call in error suppression
[lhc/web/wiklou.git] / includes / cache / localisation / LocalisationCache.php
index 90108eb..9e2a2fd 100644 (file)
@@ -524,7 +524,12 @@ class LocalisationCache {
                Wikimedia\restoreWarnings();
 
                if ( $_fileType == 'core' || $_fileType == 'extension' ) {
+
+                       // Lnguage files aren't required to contain all the possible variables, so suppress warnings
+                       // when variables don't exist in tests
+                       Wikimedia\suppressWarnings();
                        $data = compact( self::$allKeys );
+                       Wikimedia\restoreWarnings();
                } elseif ( $_fileType == 'aliases' ) {
                        $data = compact( 'aliases' );
                } else {