From: Alexandre Emsenhuber Date: Fri, 20 Jul 2012 18:46:24 +0000 (+0200) Subject: Use WebRequest instead of $_SERVER in EditPage. X-Git-Tag: 1.31.0-rc.0~22995 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=c5727b55a52387d586ad88e0af249ea14294c0af;p=lhc%2Fweb%2Fwiklou.git Use WebRequest instead of $_SERVER in EditPage. Change-Id: I30cdcffe8c520f9a4031c31e3e08db9b699da597 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index b4a67924b3..03f5ba7839 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3140,12 +3140,14 @@ HTML * @private */ function checkUnicodeCompliantBrowser() { - global $wgBrowserBlackList; - if ( empty( $_SERVER["HTTP_USER_AGENT"] ) ) { + global $wgBrowserBlackList, $wgRequest; + + $currentbrowser = $wgRequest->getHeader( 'User-Agent' ); + if ( $currentbrowser === false ) { // No User-Agent header sent? Trust it by default... return true; } - $currentbrowser = $_SERVER["HTTP_USER_AGENT"]; + foreach ( $wgBrowserBlackList as $browser ) { if ( preg_match( $browser, $currentbrowser ) ) { return false;