mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding null value checks to Set::diff()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4499 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
6331a6d4c4
commit
4fb52738d3
1 changed files with 5 additions and 0 deletions
|
@ -261,6 +261,11 @@ class Set extends Object {
|
|||
}
|
||||
|
||||
$out = array();
|
||||
if (empty($val1)) {
|
||||
return (array)$val2;
|
||||
} elseif (empty($val2)) {
|
||||
return (array)$val1;
|
||||
}
|
||||
foreach ($val1 as $key => $val) {
|
||||
if (!isset($val2[$key]) || $val2[$key] != $val) {
|
||||
$out[$key] = $val;
|
||||
|
|
Loading…
Reference in a new issue