Null values fixed for PHP 5.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62188 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2008-09-10 22:16:35 +00:00
parent 864875c2fa
commit 635928afad

View File

@ -308,6 +308,10 @@ class ViewableData extends Object implements IteratorAggregate {
$identifier = $fieldName; $identifier = $fieldName;
} }
// Fix for PHP 5.3 - $args cannot be null
if(is_null($args))
$args=Array();
if(isset($this->_object_cache[$identifier])) { if(isset($this->_object_cache[$identifier])) {
$fieldObj = $this->_object_cache[$identifier]; $fieldObj = $this->_object_cache[$identifier];
} else { } else {
@ -390,6 +394,10 @@ class ViewableData extends Object implements IteratorAggregate {
} }
} }
// Fix for PHP 5.3 - $args cannot be null
if(is_null($args))
$args=Array();
// This will happen when cachedCall was called on an object; don't bother re-calling the method, just // This will happen when cachedCall was called on an object; don't bother re-calling the method, just
// do the conversion step below // do the conversion step below
if($cache && isset($this->_object_cache[$identifier])) { if($cache && isset($this->_object_cache[$identifier])) {
@ -528,6 +536,10 @@ class ViewableData extends Object implements IteratorAggregate {
} }
} }
// Fix for PHP 5.3 - $args cannot be null
if(is_null($args))
$args=Array();
if(isset($this->_natural_cache[$identifier])) { if(isset($this->_natural_cache[$identifier])) {
if(isset($_GET['debug_profile'])) { if(isset($_GET['debug_profile'])) {
Profiler::unmark("template($funcName)", " on $this->class"); Profiler::unmark("template($funcName)", " on $this->class");