mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Compare both value and type
This commit is contained in:
@@ -2465,24 +2465,24 @@
|
||||
if (is_array($array_value)) { continue; }
|
||||
|
||||
//normalize the boolean data
|
||||
if ($array_value == 'true' || $array_value == 'false') {
|
||||
if ($parent_results[$i][$array_key] == 0) {
|
||||
if ($array_value === 'true' || $array_value === 'false') {
|
||||
if ($parent_results[$i][$array_key] === 0) {
|
||||
$parent_results[$i][$array_key] = 'false';
|
||||
}
|
||||
if ($parent_results[$i][$array_key] == 1) {
|
||||
if ($parent_results[$i][$array_key] === 1) {
|
||||
$parent_results[$i][$array_key] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
//verify if the data in the database has been modified
|
||||
if ($parent_results[$i][$array_key] != $array_value) {
|
||||
if ($parent_results[$i][$array_key] !== $array_value) {
|
||||
//echo "no match\n";
|
||||
//echo "$parent_name.$array_key ".($parent_results[0][$array_key])." != ".$array_value."\n\n";
|
||||
$data_modified = true;
|
||||
break;
|
||||
}
|
||||
|
||||
//inrement the id
|
||||
//increment the id
|
||||
$i;
|
||||
}
|
||||
}
|
||||
@@ -2726,17 +2726,17 @@
|
||||
$k = self::sanitize($k);
|
||||
|
||||
//normalize the boolean data
|
||||
if ($v == 'true' || $v == 'false') {
|
||||
if ($parent_results[$k] == 0) {
|
||||
if ($v === 'true' || $v === 'false') {
|
||||
if ($parent_results[$k] === 0) {
|
||||
$parent_results[$k] = 'false';
|
||||
}
|
||||
if ($child_results[$k] == 1) {
|
||||
if ($child_results[$k] === 1) {
|
||||
$child_results[$k] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
//verify if the data in the database has been modified
|
||||
if ($child_results[$k] != $v) {
|
||||
if ($child_results[$k] !== $v) {
|
||||
//echo "no match\n";
|
||||
//echo "$child_name.$k ".($child_results[$k])." != ".$v."\n\n";
|
||||
$data_modified = true;
|
||||
|
||||
Reference in New Issue
Block a user