From: Fomafix Date: Thu, 21 Mar 2019 19:36:52 +0000 (+0100) Subject: WebRequest: Simplify getGPCVal X-Git-Tag: 1.34.0-rc.0~2427 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=2c75885c6fca481c4fdd37ed1851437fffcb5ba5;p=lhc%2Fweb%2Fwiklou.git WebRequest: Simplify getGPCVal * Call $contLang->checkTitleEncoding() only with a string value as parameter. (A boolean value here caused T218883.) * MediaWikiServices::getInstance()->getContentLanguage() always return a Language object. An exist check is not necessary. Change-Id: Idd3e3a2baa5072e862d7502e30079a1b33d6a866 --- diff --git a/includes/WebRequest.php b/includes/WebRequest.php index e5cdda65d4..d5b081e624 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -387,12 +387,10 @@ class WebRequest { $name = strtr( $name, '.', '_' ); if ( isset( $arr[$name] ) ) { $data = $arr[$name]; - if ( isset( $_GET[$name] ) && !is_array( $data ) ) { + if ( isset( $_GET[$name] ) && is_string( $data ) ) { # Check for alternate/legacy character encoding. $contLang = MediaWikiServices::getInstance()->getContentLanguage(); - if ( $contLang ) { - $data = $contLang->checkTitleEncoding( $data ); - } + $data = $contLang->checkTitleEncoding( $data ); } $data = $this->normalizeUnicode( $data ); return $data;