* (bug 6957) E-mail confirmation links now using English special page name
for better compatibility and keeping the links shorter. Avoids problem
with corrupt links in Gmail on IE 6.
+* (bug 14273) Fix for HTTP Accept header parsing with spaces as from Konqueror
=== API changes in 1.13 ===
function wfAcceptToPrefs( $accept, $def = '*/*' ) {
# No arg means accept anything (per HTTP spec)
if( !$accept ) {
- return array( $def => 1 );
+ return array( $def => 1.0 );
}
$prefs = array();
foreach( $parts as $part ) {
# FIXME: doesn't deal with params like 'text/html; level=1'
- @list( $value, $qpart ) = explode( ';', $part );
+ @list( $value, $qpart ) = explode( ';', trim( $part ) );
$match = array();
if( !isset( $qpart ) ) {
- $prefs[$value] = 1;
+ $prefs[$value] = 1.0;
} elseif( preg_match( '/q\s*=\s*(\d*\.\d+)/', $qpart, $match ) ) {
- $prefs[$value] = $match[1];
+ $prefs[$value] = floatval($match[1]);
}
}