mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
Issue #1631
This commit is contained in:
+12
-2
@@ -408,13 +408,23 @@ PS_OPEN_FUNC(redis)
|
||||
|
||||
/* parse parameters */
|
||||
if (url->query != NULL) {
|
||||
char *query;
|
||||
array_init(¶ms);
|
||||
|
||||
#if (PHP_VERSION_ID < 70300)
|
||||
sapi_module.treat_data(PARSE_STRING, estrdup(url->query), ¶ms);
|
||||
if (url->fragment != NULL) {
|
||||
spprintf(&query, 0, "%s#%s", url->query, url->fragment);
|
||||
} else {
|
||||
query = estrdup(url->query);
|
||||
}
|
||||
#else
|
||||
sapi_module.treat_data(PARSE_STRING, estrndup(ZSTR_VAL(url->query), ZSTR_LEN(url->query)), ¶ms);
|
||||
if (url->fragment != NULL) {
|
||||
spprintf(&query, 0, "%s#%s", ZSTR_VAL(url->query), ZSTR_VAL(url->fragment));
|
||||
} else {
|
||||
query = estrndup(ZSTR_VAL(url->query), ZSTR_LEN(url->query));
|
||||
}
|
||||
#endif
|
||||
sapi_module.treat_data(PARSE_STRING, query, ¶ms);
|
||||
|
||||
if ((param = zend_hash_str_find(Z_ARRVAL(params), "weight", sizeof("weight") - 1)) != NULL) {
|
||||
weight = zval_get_long(param);
|
||||
|
||||
Reference in New Issue
Block a user