mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-18 11:35:15 -04:00
Use === when testing for empty value and setting defaults
This commit is contained in:
@@ -206,7 +206,8 @@ class ZM_Object {
|
||||
}
|
||||
}
|
||||
} # end foreach default
|
||||
}
|
||||
} # end if defaults
|
||||
|
||||
foreach ( $new_values as $field => $value ) {
|
||||
|
||||
if ( method_exists($this, $field) ) {
|
||||
@@ -281,7 +282,7 @@ class ZM_Object {
|
||||
# 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 ) {
|
||||
|
||||
Reference in New Issue
Block a user