http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100230
Revision: 100230
Author: platonides
Date: 2011-10-19 15:15:08 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
It is valid (albeit silly) to specify lang;q=1.000 No more than three decimals
are allowed.
(rfc2616 section 3.9: Quality Values)
The language-range may contain more than one - (section 14.4) such as
x-pig-latin
(section 3.10: Language Tags)
Modified Paths:
--------------
trunk/phase3/includes/WebRequest.php
Modified: trunk/phase3/includes/WebRequest.php
===================================================================
--- trunk/phase3/includes/WebRequest.php 2011-10-19 14:52:26 UTC (rev
100229)
+++ trunk/phase3/includes/WebRequest.php 2011-10-19 15:15:08 UTC (rev
100230)
@@ -962,7 +962,7 @@
// Break up string into pieces (languages and q factors)
$lang_parse = null;
- preg_match_all(
'/([a-z]{1,8}(-[a-z]{1,8})?|\*)\s*(;\s*q\s*=\s*(1|0(\.[0-9]+)?)?)?/',
+ preg_match_all(
'/([a-z]{1,8}(-[a-z]{1,8})*|\*)\s*(;\s*q\s*=\s*(1(\.0{0,3})?|0(\.[0-9]{0,3})?)?)?/',
$acceptLang, $lang_parse );
if ( !count( $lang_parse[1] ) ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs