From 635928afad2b7f3c2a223dad9a1666ed81024bb0 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 10 Sep 2008 22:16:35 +0000 Subject: [PATCH] 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 --- core/ViewableData.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/ViewableData.php b/core/ViewableData.php index c34819236..c7e95526e 100644 --- a/core/ViewableData.php +++ b/core/ViewableData.php @@ -308,6 +308,10 @@ class ViewableData extends Object implements IteratorAggregate { $identifier = $fieldName; } + // Fix for PHP 5.3 - $args cannot be null + if(is_null($args)) + $args=Array(); + if(isset($this->_object_cache[$identifier])) { $fieldObj = $this->_object_cache[$identifier]; } 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 // do the conversion step below 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($_GET['debug_profile'])) { Profiler::unmark("template($funcName)", " on $this->class");