Move Sanitizer.php to includes/parser/
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index ee0da2a..5e2845f 100644 (file)
@@ -944,6 +944,9 @@ class ParserOptions {
                }
                if ( $lang === null ) {
                        global $wgLang;
+                       if ( !StubObject::isRealObject( $wgLang ) ) {
+                               $wgLang->_unstub();
+                       }
                        $lang = $wgLang;
                }
                $this->initialiseFromUser( $user, $lang );
@@ -1011,7 +1014,7 @@ class ParserOptions {
         *
         * @since 1.30
         * @param User|null $user
-        * @param Language|null $lang
+        * @param Language|StubObject|null $lang
         * @return ParserOptions
         */
        public static function newCanonical( User $user = null, $lang = null ) {
@@ -1059,13 +1062,11 @@ class ParserOptions {
                                'speculativeRevIdCallback' => null,
                        ];
 
-                       // @codingStandardsIgnoreStart Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfterAmp
                        Hooks::run( 'ParserOptionsRegister', [
                                &self::$defaults,
                                &self::$inCacheKey,
                                &self::$lazyOptions,
                        ] );
-                       // @codingStandardsIgnoreEnd
 
                        ksort( self::$inCacheKey );
                }