Skip to content

Commit

Permalink
fix issue laruence#134
Browse files Browse the repository at this point in the history
  • Loading branch information
chiyou committed Nov 7, 2014
1 parent 21e13c9 commit a718fa2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions routes/yaf_route_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_rewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, '?');
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_supervar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a718fa2

Please sign in to comment.