Browse Source

Make get_browser() read its information from $HTTP_SERVER_VARS[] if available

PHP-4.0.6
Zeev Suraski 25 years ago
parent
commit
8b5a768640
  1. 4
      NEWS
  2. 3
      ext/standard/browscap.c

4
NEWS

@ -1,6 +1,10 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, Version 4.0.6
- Added mysql_unbuffered_query(), which is useful for very large result sets
(Zeev)
?? ??? 200?, Version 4.0.5
- Added array_reduce(), which allows iterative reduction of an array
to a single value via a callback function. (Andrei)

3
ext/standard/browscap.c

@ -203,7 +203,8 @@ PHP_FUNCTION(get_browser)
switch(ZEND_NUM_ARGS()) {
case 0:
if (zend_hash_find(&EG(symbol_table), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {
if (!PG(http_globals)[TRACK_VARS_SERVER]
|| zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {
zend_error(E_WARNING,"HTTP_USER_AGENT variable is not set, cannot determine user agent name");
RETURN_FALSE;
}

Loading…
Cancel
Save