diff --git a/routes/yaf_route_map.c b/routes/yaf_route_map.c index 59e0b406..21183bee 100644 --- a/routes/yaf_route_map.c +++ b/routes/yaf_route_map.c @@ -200,7 +200,7 @@ zval * yaf_route_map_assemble(yaf_route_t *this_ptr, zval *info, zval *query TSR } efree(pname); - if (IS_ARRAY == Z_TYPE_P(query)) { + if (query && IS_ARRAY == Z_TYPE_P(query)) { uint key_len, i = 0; char *key; ulong key_idx; @@ -271,7 +271,7 @@ PHP_METHOD(yaf_route_map, __construct) { /** {{{ proto public Yaf_Route_Map::assemble(array $info[, array $query = NULL]) */ PHP_METHOD(yaf_route_map, assemble) { - zval *info, *query; + zval *info, *query = NULL; zval *return_uri; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &info, &query) == FAILURE) { diff --git a/routes/yaf_route_regex.c b/routes/yaf_route_regex.c index f306779e..bfc6e002 100644 --- a/routes/yaf_route_regex.c +++ b/routes/yaf_route_regex.c @@ -192,7 +192,7 @@ zval * yaf_route_regex_assemble(yaf_route_t *this_ptr, zval *info, zval *query T tstr = inter; } - if (IS_ARRAY == Z_TYPE_P(query)) { + if (query && IS_ARRAY == Z_TYPE_P(query)) { uint key_len; char *key; ulong key_idx; @@ -359,7 +359,7 @@ PHP_METHOD(yaf_route_regex, __construct) { /** {{{ proto public Yaf_Route_regex::assemble(array $info[, array $query = NULL]) */ PHP_METHOD(yaf_route_regex, assemble) { - zval *info, *query, *return_uri = NULL; + zval *info, *query = NULL, *return_uri = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &info, &query) == FAILURE) { return; diff --git a/routes/yaf_route_rewrite.c b/routes/yaf_route_rewrite.c index 6cc81717..eda0885f 100644 --- a/routes/yaf_route_rewrite.c +++ b/routes/yaf_route_rewrite.c @@ -330,7 +330,7 @@ zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *info, zval *query efree(pmatch); zval_ptr_dtor(&pidents); - if (IS_ARRAY == Z_TYPE_P(query)) { + if (query && IS_ARRAY == Z_TYPE_P(query)) { HashTable *ht = Z_ARRVAL_P(query); smart_str_appendc(&squery, '?'); @@ -421,7 +421,7 @@ PHP_METHOD(yaf_route_rewrite, __construct) { /** {{{ proto public Yaf_Route_rewrite::assemble(array $info[, array $query = NULL]) */ PHP_METHOD(yaf_route_rewrite, assemble) { - zval *info, *query, *return_uri = NULL; + zval *info, *query = NULL, *return_uri = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &info, &query) == FAILURE) { return; diff --git a/routes/yaf_route_simple.c b/routes/yaf_route_simple.c index 71377348..05213d5c 100644 --- a/routes/yaf_route_simple.c +++ b/routes/yaf_route_simple.c @@ -150,7 +150,7 @@ zval * yaf_route_simple_assemble(yaf_route_t *this_ptr, zval *info, zval *query smart_str_appendc(&tvalue, '='); smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - if (IS_ARRAY == Z_TYPE_P(query)) { + if (query && IS_ARRAY == Z_TYPE_P(query)) { uint key_len; char *key; ulong key_idx; @@ -206,7 +206,7 @@ PHP_METHOD(yaf_route_simple, __construct) { /** {{{ proto public Yaf_Route_Simple::assemble(array $info[, array $query = NULL]) */ PHP_METHOD(yaf_route_simple, assemble) { - zval *info, *query; + zval *info, *query = NULL; zval *return_uri; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &info, &query) == FAILURE) { diff --git a/routes/yaf_route_static.c b/routes/yaf_route_static.c index 182882a0..846fdafb 100644 --- a/routes/yaf_route_static.c +++ b/routes/yaf_route_static.c @@ -211,7 +211,7 @@ zval * yaf_route_static_assemble(yaf_route_t *this_ptr, zval *info, zval *query smart_str_appendc(&tvalue, '/'); smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - if (IS_ARRAY == Z_TYPE_P(query)) { + if (query && IS_ARRAY == Z_TYPE_P(query)) { uint key_len; char *key; ulong key_idx; @@ -275,7 +275,7 @@ PHP_METHOD(yaf_route_static, match) { /** {{{ proto public Yaf_Route_Static::assemble(array $info[, array $query = NULL]) */ PHP_METHOD(yaf_route_static, assemble) { - zval *info, *query; + zval *info, *query = NULL; zval *return_uri; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &info, &query) == FAILURE) { diff --git a/routes/yaf_route_supervar.c b/routes/yaf_route_supervar.c index 9b97db64..ec599cf7 100644 --- a/routes/yaf_route_supervar.c +++ b/routes/yaf_route_supervar.c @@ -137,7 +137,7 @@ zval * yaf_route_supervar_assemble(yaf_route_t *this_ptr, zval *info, zval *quer smart_str_appendc(&tvalue, '/'); smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - if (IS_ARRAY == Z_TYPE_P(query)) { + if (query && IS_ARRAY == Z_TYPE_P(query)) { uint key_len; char *key; ulong key_idx; @@ -191,7 +191,7 @@ PHP_METHOD(yaf_route_supervar, __construct) { /** {{{ proto public Yaf_Route_Supervar::assemble(array $info[, array $query = NULL]) */ PHP_METHOD(yaf_route_supervar, assemble) { - zval *info, *query; + zval *info, *query = NULL; zval *return_uri; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &info, &query) == FAILURE) {