Fixed PHP warning showing up on some extract queries

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6658 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
the_undefined 2008-04-13 13:32:58 +00:00
parent 1fdd44f6b2
commit de4807e726
2 changed files with 10 additions and 0 deletions

View file

@ -487,6 +487,9 @@ class Set extends Object {
continue;
}
list(,$key,$op,$expected) = $match;
if (!isset($data[$key])) {
return false;
}
$val = $data[$key];
if ($op == '=' && $val != $expected) {
return false;

View file

@ -470,6 +470,13 @@ class SetTest extends UnitTestCase {
'text' => 'Comment 5',
),
),
),
array(
'Article' => array(
'id' => 3,
'name' => 'Article 3',
),
'Comment' => array(),
)
);