Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1266,7 +1266,7 @@ |
1267 | 1267 | function wfAcceptToPrefs( $accept, $def = '*/*' ) { |
1268 | 1268 | # No arg means accept anything (per HTTP spec) |
1269 | 1269 | if( !$accept ) { |
1270 | | - return array( $def => 1 ); |
| 1270 | + return array( $def => 1.0 ); |
1271 | 1271 | } |
1272 | 1272 | |
1273 | 1273 | $prefs = array(); |
— | — | @@ -1275,12 +1275,12 @@ |
1276 | 1276 | |
1277 | 1277 | foreach( $parts as $part ) { |
1278 | 1278 | # FIXME: doesn't deal with params like 'text/html; level=1' |
1279 | | - @list( $value, $qpart ) = explode( ';', $part ); |
| 1279 | + @list( $value, $qpart ) = explode( ';', trim( $part ) ); |
1280 | 1280 | $match = array(); |
1281 | 1281 | if( !isset( $qpart ) ) { |
1282 | | - $prefs[$value] = 1; |
| 1282 | + $prefs[$value] = 1.0; |
1283 | 1283 | } elseif( preg_match( '/q\s*=\s*(\d*\.\d+)/', $qpart, $match ) ) { |
1284 | | - $prefs[$value] = $match[1]; |
| 1284 | + $prefs[$value] = floatval($match[1]); |
1285 | 1285 | } |
1286 | 1286 | } |
1287 | 1287 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -306,6 +306,7 @@ |
307 | 307 | * (bug 6957) E-mail confirmation links now using English special page name |
308 | 308 | for better compatibility and keeping the links shorter. Avoids problem |
309 | 309 | with corrupt links in Gmail on IE 6. |
| 310 | +* (bug 14273) Fix for HTTP Accept header parsing with spaces as from Konqueror |
310 | 311 | |
311 | 312 | |
312 | 313 | === API changes in 1.13 === |