summaryrefslogtreecommitdiffstats
path: root/Acl
diff options
context:
space:
mode:
authorChristian Flothmann <christian.flothmann@xabbuh.de>2015-05-31 17:00:49 +0200
committerChristian Flothmann <christian.flothmann@xabbuh.de>2015-05-31 17:00:49 +0200
commit1bd6c22e4ef584f059b5f0aa3591e651ad70f806 (patch)
tree1f7b6e868ed6fbfe8b8941ca76e33f4bd1d7ee6c /Acl
parentb3d032613d74a7d5d7babeee28d9ac8f870ff36c (diff)
downloadsymfony-security-1bd6c22e4ef584f059b5f0aa3591e651ad70f806.zip
symfony-security-1bd6c22e4ef584f059b5f0aa3591e651ad70f806.tar.gz
symfony-security-1bd6c22e4ef584f059b5f0aa3591e651ad70f806.tar.bz2
[Security][Acl] enforce string identifiers
Diffstat (limited to 'Acl')
-rw-r--r--Acl/Domain/ObjectIdentity.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/Acl/Domain/ObjectIdentity.php b/Acl/Domain/ObjectIdentity.php
index 907b1d8..fc5b9c6 100644
--- a/Acl/Domain/ObjectIdentity.php
+++ b/Acl/Domain/ObjectIdentity.php
@@ -36,7 +36,7 @@ final class ObjectIdentity implements ObjectIdentityInterface
*/
public function __construct($identifier, $type)
{
- if (empty($identifier)) {
+ if ('' === $identifier) {
throw new \InvalidArgumentException('$identifier cannot be empty.');
}
if (empty($type)) {
@@ -66,7 +66,7 @@ final class ObjectIdentity implements ObjectIdentityInterface
if ($domainObject instanceof DomainObjectInterface) {
return new self($domainObject->getObjectIdentifier(), ClassUtils::getRealClass($domainObject));
} elseif (method_exists($domainObject, 'getId')) {
- return new self($domainObject->getId(), ClassUtils::getRealClass($domainObject));
+ return new self((string) $domainObject->getId(), ClassUtils::getRealClass($domainObject));
}
} catch (\InvalidArgumentException $invalid) {
throw new InvalidDomainObjectException($invalid->getMessage(), 0, $invalid);