Issues

ZF-6147: Zend_Acl incorrect handling on non existent privilege when evaluating a role permission

Description

Suppose the following code:


$acl=new Zend_Acl();
$acl->addRole(new Zend_Acl_Role('role'));
$acl->add(new Zend_Acl_Resource('resource'));
$acl->allow('role','resource');
$acl->isAllowed('role','resource',array('nonExistentPriv'));

Expected behavior: 'role' allowed to access the resource (because it was registered with null privileges in the allow rule) or an exception with a message similar to "resource privilege nonExistentPriv is not registered"

Actual behavior: PHP Warning Illegal offset type in isset or empty File: Zend\Acl.php Line: 961

Comments

Zend_Acl should not be emmiting any php warnings in any valid use of the API. Changing to bug, nice to have, next mini release.

Please not that the third parameter of isAllowed should be a string (or null) and not an array. Therefore closing this issue as not-an-issue.