Browse Source

Check if property is set

```getValue``` didn't check if the property on an object exists so wouldn't return the default value.
tags/2.0.0-rc
Alex-Code 11 years ago
parent
commit
274828839b
  1. 2
      framework/helpers/BaseArrayHelper.php

2
framework/helpers/BaseArrayHelper.php

@ -181,7 +181,7 @@ class BaseArrayHelper
$key = substr($key, $pos + 1);
}
if (is_object($array)) {
if (is_object($array) && isset($array->$key)) {
return $array->$key;
} elseif (is_array($array)) {
return array_key_exists($key, $array) ? $array[$key] : $default;

Loading…
Cancel
Save