ssb Sat Nov 30 05:24:03 2002 EDT
Modified files:
/pear/HTTP HTTP.php
Log:
* be more flexible when parsing Accept-Language header
Index: pear/HTTP/HTTP.php
diff -u pear/HTTP/HTTP.php:1.15 pear/HTTP/HTTP.php:1.16
--- pear/HTTP/HTTP.php:1.15 Thu Apr 25 07:04:20 2002
+++ pear/HTTP/HTTP.php Sat Nov 30 05:24:03 2002
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: HTTP.php,v 1.15 2002/04/25 11:04:20 richard Exp $
+// $Id: HTTP.php,v 1.16 2002/11/30 10:24:03 ssb Exp $
//
// HTTP utility functions.
//
@@ -84,7 +84,7 @@
if (isset($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'])) {
$accepted = split(',[[:space:]]*',
$HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']);
for ($i = 0; $i < count($accepted); $i++) {
- if (eregi('^([a-z]+);[[:space:]]*q=([0-9\.]+)', $accepted[$i],
$arr)) {
+ if (eregi('^([a-z_-]+);[[:space:]]*q=([0-9\.]+)',
$accepted[$i], $arr)) {
$q = (double)$arr[2];
$l = $arr[1];
} else {
@@ -204,4 +204,4 @@
exit;
}
}
-?>
\ No newline at end of file
+?>
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|