Cache the result of User::getDefaultOptions(), so the UserGetDefaultOptions hook...
[lhc/web/wiklou.git] / includes / User.php
index e3e2c9a..973a304 100644 (file)
@@ -1207,6 +1207,10 @@ class User {
         */
        public static function getDefaultOptions() {
                global $wgNamespacesToBeSearchedDefault, $wgDefaultUserOptions, $wgContLang, $wgDefaultSkin;
+               static $defOpt = null;
+               if ( $defOpt !== null ) {
+                       return $defOpt;
+               }
 
                $defOpt = $wgDefaultUserOptions;
                # default language setting