Cache the result of User::getDefaultOptions(), so the UserGetDefaultOptions hook...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 1 Nov 2011 15:55:57 +0000 (15:55 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 1 Nov 2011 15:55:57 +0000 (15:55 +0000)
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