diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-11-06 17:50:48 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-11-06 17:50:48 +0100 |
commit | b312598daf8da5d7bc3224fc9a371b3ee3b78276 (patch) | |
tree | c498a147a8941a8b278992ee4ae33494ca0def87 /ext/standard/browscap.c | |
parent | 34ea5b0585946d8ec6afc17dfa78f66b48383320 (diff) | |
download | php-git-b312598daf8da5d7bc3224fc9a371b3ee3b78276.tar.gz |
Move extra checks after zpp in get_browser()
Diffstat (limited to 'ext/standard/browscap.c')
-rw-r--r-- | ext/standard/browscap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index a98810bc43..8e99b925db 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -686,6 +686,12 @@ PHP_FUNCTION(get_browser) browscap_entry *found_entry = NULL; HashTable *agent_ht; + ZEND_PARSE_PARAMETERS_START(0, 2) + Z_PARAM_OPTIONAL + Z_PARAM_STR_EX(agent_name, 1, 0) + Z_PARAM_BOOL(return_array) + ZEND_PARSE_PARAMETERS_END(); + if (BROWSCAP_G(activation_bdata).filename[0] != '\0') { bdata = &BROWSCAP_G(activation_bdata); if (bdata->htab == NULL) { /* not initialized yet */ @@ -701,12 +707,6 @@ PHP_FUNCTION(get_browser) bdata = &global_bdata; } - ZEND_PARSE_PARAMETERS_START(0, 2) - Z_PARAM_OPTIONAL - Z_PARAM_STR_EX(agent_name, 1, 0) - Z_PARAM_BOOL(return_array) - ZEND_PARSE_PARAMETERS_END(); - if (agent_name == NULL) { zval *http_user_agent = NULL; if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY |