X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=Civi%2FCore%2FSettingsBag.php;h=2aee1eb1c205b2bf799e1f256dc67e9654f564f9;hb=07cd5d66af83e516365784210f302b60e4e597c1;hp=14289499244f2cfe8061e2704c0909815102716c;hpb=894aaa017e254a83f9383d3d9e68d127f1bb7e87;p=civicrm-core.git diff --git a/Civi/Core/SettingsBag.php b/Civi/Core/SettingsBag.php index 1428949924..2aee1eb1c2 100644 --- a/Civi/Core/SettingsBag.php +++ b/Civi/Core/SettingsBag.php @@ -352,7 +352,9 @@ class SettingsBag { } $dao->find(TRUE); - if (isset($metadata['on_change']) && !($value == 0 && ($dao->value === NULL || unserialize($dao->value) == 0))) { + // string comparison with 0 always return true, so to be ensure the type use === + // ref - https://stackoverflow.com/questions/8671942/php-string-comparasion-to-0-integer-returns-true + if (isset($metadata['on_change']) && !($value === 0 && ($dao->value === NULL || unserialize($dao->value) == 0))) { foreach ($metadata['on_change'] as $callback) { call_user_func( \Civi\Core\Resolver::singleton()->get($callback),