Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1513 Use zend_symtable_update instead of zend_hash_update #1517

Merged
merged 1 commit into from
Nov 7, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/kernel/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ int phalcon_update_property_array(zval *object, char *property, unsigned int pro
Z_ADDREF_P(value);

if (Z_TYPE_P(index) == IS_STRING) {
zend_hash_update(Z_ARRVAL_P(tmp), Z_STRVAL_P(index), Z_STRLEN_P(index) + 1, &value, sizeof(zval *), NULL);
zend_symtable_update(Z_ARRVAL_P(tmp), Z_STRVAL_P(index), Z_STRLEN_P(index) + 1, &value, sizeof(zval*), NULL);
} else {
if (Z_TYPE_P(index) == IS_LONG) {
zend_hash_index_update(Z_ARRVAL_P(tmp), Z_LVAL_P(index), &value, sizeof(zval *), NULL);
Expand Down
13 changes: 13 additions & 0 deletions unit-tests/AclTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,17 @@ public function testMemory()
$acl->allow('*', '*', '*');
*/
}

public function testIssues1513()
{
try {
$acl = new \Phalcon\Acl\Adapter\Memory();
$acl->setDefaultAction(Phalcon\Acl::DENY);
$acl->addRole(new \Phalcon\Acl\Role('11'));
$acl->addResource(new \Phalcon\Acl\Resource('11'), array('index'));
$this->assertTrue(TRUE);
} catch (Exception $e) {
$this->assertTrue(FALSE);
}
}
}