Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding sanity checking to setup() callback for behaviors.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8002 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 76fba20721a2fe36a77ec57fd1fb4be26bb53a91 1 parent 1111829
@nateabele nateabele authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 cake/libs/model/behavior.php
View
5 cake/libs/model/behavior.php
@@ -279,12 +279,15 @@ function attach($behavior, $config = array()) {
$this->{$name} =& new $class;
}
} elseif (isset($this->{$name}->settings) && isset($this->{$name}->settings[$this->modelName])) {
- if ($config !== null && $config !== false) {
+ if (!empty($config)) {
$config = array_merge($this->{$name}->settings[$this->modelName], $config);
} else {
$config = array();
}
}
+ if (empty($config)) {
+ $config = array();
+ }
$this->{$name}->setup(ClassRegistry::getObject($this->modelName), $config);
foreach ($this->{$name}->mapMethods as $method => $alias) {
Please sign in to comment.
Something went wrong with that request. Please try again.