Skip to content

Commit

Permalink
Update dispatcher.c
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamsxin authored Jun 28, 2020
1 parent 0bb94f4 commit 5042796
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ext/dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,8 +1334,11 @@ PHP_METHOD(Phalcon_Dispatcher, forward){
if (Z_TYPE_P(forward) == IS_STRING) {
array_init(&forward_parts);
PHALCON_MM_ADD_ENTRY(&forward_parts);

phalcon_fast_explode_str(&parts, SL("::"), forward);
if (phalcon_memnstr_str(forward, SL("::"))) {
phalcon_fast_explode_str(&parts, SL("::"), forward);
} else {
phalcon_fast_explode_str(&parts, SL("/"), forward);
}
phalcon_fast_count(&number_parts, &parts);

num = phalcon_get_intval(&number_parts);
Expand Down Expand Up @@ -1376,7 +1379,7 @@ PHP_METHOD(Phalcon_Dispatcher, forward){
zval_ptr_dtor(&real_controller_name);
phalcon_array_update_str(&forward_parts, SL("controller"), &controller_part, 0);

if (Z_TYPE(action_part) != IS_NULL) {
if (Z_TYPE(action_part) > IS_NULL) {
phalcon_array_update_str(&forward_parts, SL("action"), &action_part, PH_COPY);
}
}
Expand Down

0 comments on commit 5042796

Please sign in to comment.