libs/override/web/NpUrlManager.php
protected function matchCode($code)
	{
		$language = $code;
		$country = null;
		$parts = explode('-', $code);
		if (count($parts)===2) {
			$language = $parts[0];
			$country = strtoupper($parts[1]);
		}
		if (in_array($code, $this->languages)) {
			return [$language, $country];
		} elseif (
			$country && in_array("$language-$country", $this->languages) ||
			in_array("$language-*", $this->languages)
		) {
			return [$language, $country];
		} elseif (in_array($language, $this->languages)) {
			return [$language, null];
		} else {
			return [null, null];
		}
	}
protected function matchCode($code)
	{
		$language = $code;
		$country = null;
		$parts = explode('-', $code);
		if (count($parts)===2) {
			$language = $parts[0];
			$country = strtoupper($parts[1]);
		}
		if (in_array($code, $this->languages)) {
			return [$language, $country];
		} elseif (
			$country && in_array("$language-$country", $this->languages) ||
			in_array("$language-*", $this->languages)
		) {
			return [$language, $country];
		} elseif (in_array($language, $this->languages)) {
			return [$language, null];
		} else {
			return [null, null];
		}
	}
protected function matchCode ( $ code ) { $ language = $ code ; $ country = null ; $ parts = explode ( '-' , $ code ) ; if ( count ( $ parts ) === 2 ) { $ language = $ parts [ 0 ] ; $ country = strtoupper ( $ parts [ 1 ] ) ; } if ( in_array ( $ code , $ this -> languages ) ) { return [ $ language , $ country ] ; } elseif ( $ country && in_array ( "$language-$country" , $ this -> languages ) || in_array ( "$language-*" , $ this -> languages ) ) { return [ $ language , $ country ] ; } elseif ( in_array ( $ language , $ this -> languages ) ) { return [ $ language , null ] ; } else { return [ null , null ] ; } }
Tests whether the given code matches any of the configured languages.

If the code is a single language code, and matches either

- an exact language as configured (ll)
- a language with a country wildcard (ll-*)

this language code is returned.

If the code also contains a country code, and matches either

- an exact language/country code as configured (ll-CC)
- a language with a country wildcard (ll-*)

the code with uppercase country is returned. If only the language part matches
a configured language, that language is returned.

@param string $code the code to match
@return array of [language, country], [language, null] or [null, null] if no match
Tests whether the given code matches any of the configured languages .