]> granicus.if.org Git - php/commitdiff
fix get_browser() (broken in the process of param API conversion)
authorAntony Dovgal <tony2001@php.net>
Fri, 29 Aug 2008 14:13:57 +0000 (14:13 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 29 Aug 2008 14:13:57 +0000 (14:13 +0000)
ext/standard/browscap.c

index 271fd3bfd410825c9dc34283acca8142db34b712..f5ea50837f707183c5593bca325dae977abae8a4 100644 (file)
@@ -328,7 +328,7 @@ PHP_FUNCTION(get_browser)
        char *agent_name = NULL;
        int agent_name_len;
        zend_bool return_array = 0;
-       zval **agent;
+       zval **agent, **z_agent_name;
        zval *found_browser_entry, *tmp_copy;
        char *lookup_browser_name;
        char *browscap = INI_STR("browscap");
@@ -375,8 +375,8 @@ PHP_FUNCTION(get_browser)
                zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
        }
 
-       while (zend_hash_find(Z_ARRVAL_PP(agent), "parent", sizeof("parent"), (void **) &agent_name) == SUCCESS) {
-               if (zend_hash_find(&browser_hash, agent_name, agent_name_len + 1, (void **)&agent) == FAILURE) {
+       while (zend_hash_find(Z_ARRVAL_PP(agent), "parent", sizeof("parent"), (void **) &z_agent_name) == SUCCESS) {
+               if (zend_hash_find(&browser_hash, Z_STRVAL_PP(z_agent_name), Z_STRLEN_PP(z_agent_name) + 1, (void **)&agent) == FAILURE) {
                        break;
                }