Author: cybercoolcougar
Description:
When editing a page using Internet Explorer 6, Mediawiki says "Your browser is not unicode-compliant,
blahblah".
I did some debugging and found:
In the file includes\DefaultSettins.php,
several REGEXP patterns are defined on non-compliant browsers:
$wgBrowserBlackList = array(
/** * Netscape 2-4 detection * The minor version may contain strings such as "Gold" or "SGoldC-SGI" * Lots of non-netscape user agents have "compatible", so it's useful to check for that * with a negative assertion. The [UIN] identifier specifies the level of security * in a Netscape/Mozilla browser, checking for it rules out a number of fakers. * The language string is unreliable, it is missing on NS4 Mac. * * Reference: http://www.psychedelix.com/agents/index.shtml */ '/^Mozilla\/2\.[^ ]+ .*?\((?!compatible).*; [UIN]/', '/^Mozilla\/3\.[^ ]+ .*?\((?!compatible).*; [UIN]/', '/^Mozilla\/4\.[^ ]+ .*?\((?!compatible).*; [UIN]/',
#NOTE THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/** * MSIE on Mac OS 9 is teh sux0r, converts þ to <thorn>, ð to <eth>, Þ to <THORN> and Ð to <ETH> * * Known useragents: * - Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) * - Mozilla/4.0 (compatible; MSIE 5.15; Mac_PowerPC) * - Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC) * - [...] * * @link http://en.wikipedia.org/w/index. ... &oldid=12355864 * @link http://en.wikipedia.org/wiki/Template%3AOS9 */ '/^Mozilla\/4\.0 \(compatible; MSIE \d+\.\d+; Mac_PowerPC\)/'
);
And in the file includes\EditPage.php, the current browser's USER-AGENT string is checked against the
patterns:
function checkUnicodeCompliantBrowser() { global $wgBrowserBlackList; if( empty( $_SERVER["HTTP_USER_AGENT"] ) ) { // 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; } } return true; }
Note the 3rd pattern,
'/^Mozilla\/4\.[^ ]+ .*?\((?!compatible).*; [UIN]/',
it will match the IE6's USER-AGENT string on my machine, whick is shown below:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; iebar; .NET CLR 1.1.4322; InfoPath.1)
Please note the "InfoPath.1" part near the end of the string, it is there because I installed InfoPath,
a component of Microsoft Office 2003. The starting letter 'I' makes it matched with the 3rd pattern.
Version: 1.10.x
Severity: normal
OS: Windows XP
Platform: PC
URL: http://<found-in-intranet-site-so-no-useful-info-here>