Skip to content

Commit

Permalink
Fix #1504
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Nov 2, 2013
1 parent 3f514e7 commit 176dfdb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ext/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,19 @@ static void phalcon_config_write_internal(phalcon_config_object *object, zval *o
{
if (Z_TYPE_P(value) == IS_ARRAY) {
zval *instance;
MAKE_STD_ZVAL(instance);
object_init_ex(instance, phalcon_config_ce);
phalcon_config_construct_internal(instance, value TSRMLS_CC);
phalcon_hash_update_or_insert(object->props, offset, instance);
HashTable *h = Z_ARRVAL_P(value);

if (!h->nApplyCount) {
++h->nApplyCount;
MAKE_STD_ZVAL(instance);
object_init_ex(instance, phalcon_config_ce);
phalcon_config_construct_internal(instance, value TSRMLS_CC);
phalcon_hash_update_or_insert(object->props, offset, instance);
--h->nApplyCount;
}
else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recursion detected");
}
}
else {
Z_ADDREF_P(value);
Expand Down

0 comments on commit 176dfdb

Please sign in to comment.