X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguageConverter.php;h=d11838a8b7d3cb2e10bedb217d061c70b003be4a;hb=ade631c612cc9c86c133005f5e898041b9240084;hp=1f720af26c664028848b770cbb740b35c4c14da7;hpb=76d072e4813b8d28630d7a3768bccc37bf54f7f5;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 1f720af26c..d11838a8b7 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -39,6 +39,7 @@ class LanguageConverter { */ static public $languagesWithVariants = [ 'en', + 'crh', 'gan', 'iu', 'kk', @@ -162,6 +163,8 @@ class LanguageConverter { $req = $this->getURLVariant(); + Hooks::run( 'GetLangPreferredVariant', [ &$req ] ); + if ( $wgUser->isSafeToLoad() && $wgUser->isLoggedIn() && !$req ) { $req = $this->getUserVariant(); } elseif ( !$req ) { @@ -679,9 +682,8 @@ class LanguageConverter { $noScript = '.*?<\/script>(*SKIP)(*FAIL)'; $noStyle = '.*?<\/style>(*SKIP)(*FAIL)'; - // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong + // phpcs:ignore Generic.Files.LineLength $noHtml = '<(?:[^>=]*+(?>[^>=]*+=\s*+(?:"[^"]*"|\'[^\']*\'|[^\'">\s]*+))*+[^>=]*+>|.*+)(*SKIP)(*FAIL)'; - // @codingStandardsIgnoreEnd while ( $startPos < $length && $continue ) { $continue = preg_match( // Only match -{ outside of html. @@ -965,11 +967,11 @@ class LanguageConverter { * Parse the conversion table stored in the cache. * * The tables should be in blocks of the following form: - * -{ - * word => word ; - * word => word ; - * ... - * }- + * -{ + * word => word ; + * word => word ; + * ... + * }- * * To make the tables more manageable, subpages are allowed * and will be parsed recursively if $recursive == true.