浏览代码

[Security] fixed cast

Fabien Potencier 13 年之前
父节点
当前提交
b7fd5198ec
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Symfony/Component/Security/Core/SecurityContext.php

+ 5 - 1
src/Symfony/Component/Security/Core/SecurityContext.php

@@ -63,7 +63,11 @@ class SecurityContext implements SecurityContextInterface
             $this->token = $this->authenticationManager->authenticate($this->token);
         }
 
-        return $this->accessDecisionManager->decide($this->token, (array) $attributes, $object);
+        if (!is_array($attributes)) {
+            $attributes = array($attributes);
+        }
+
+        return $this->accessDecisionManager->decide($this->token, $attributes, $object);
     }
 
     /**