From a0bd602339c03f74b20b347b0761fb16103f0e1f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 9 Mar 2020 14:39:22 -0400 Subject: [PATCH] Use === when testing for empty value and setting defaults --- web/includes/Object.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/includes/Object.php b/web/includes/Object.php index 6f2e4d8bf..9c71ed953 100644 --- a/web/includes/Object.php +++ b/web/includes/Object.php @@ -216,7 +216,8 @@ Logger::Debug("$k => Have default for $v: "); } } } # end foreach default - } + } # end if defaults + foreach ( $new_values as $field => $value ) { if ( method_exists($this, $field) ) { @@ -299,7 +300,7 @@ Logger::Debug("$k => Have default for $v: "); # Set defaults. Note that we only replace "" with null, not other values # because for example if we want to clear TimestampFormat, we clear it, but the default is a string value foreach ( $this->defaults as $field => $default ) { - if ( (!property_exists($this, $field)) or ($this->{$field} == '') ) { + if ( (!property_exists($this, $field)) or ($this->{$field} === '') ) { if ( is_array($default) ) { $this->{$field} = $default['default']; } else if ( $default == null ) {