Skip to content
This repository
Browse code

Checks for array to string conversion (E_NOTICE as of PHP5.4)

  • Loading branch information...
commit 840343ffb771b3c567381928367fdaaa7428c7d4 1 parent 75b16f6
Simon Welsh authored October 29, 2011
3  dev/Backtrace.php
@@ -136,7 +136,8 @@ static function full_func_name($item, $showArgs = false, $argCharLimit = 10000)
136 136
 			$args = array();
137 137
 			foreach($item['args'] as $arg) {
138 138
 				if(!is_object($arg) || method_exists($arg, '__toString')) {
139  
-					$args[] = (strlen((string)$arg) > $argCharLimit) ? substr((string)$arg, 0, $argCharLimit) . '...' : (string)$arg;
  139
+					$sarg = is_array($arg) ? 'Array' : strval($arg);
  140
+					$args[] = (strlen($sarg) > $argCharLimit) ? substr($sarg, 0, $argCharLimit) . '...' : $sarg;
140 141
 				} else {
141 142
 					$args[] = get_class($arg);
142 143
 				}
2  view/SSViewer.php
@@ -319,7 +319,7 @@ public function __construct($templateList) {
319 319
 			}
320 320
 		}
321 321
 		
322  
-		if(substr((string) $templateList,-3) == '.ss') {
  322
+		if(!is_array($templateList) && substr((string) $templateList,-3) == '.ss') {
323 323
 			$this->chosenTemplates['main'] = $templateList;
324 324
 		} else {
325 325
 			$this->chosenTemplates = SS_TemplateLoader::instance()->findTemplates(

0 notes on commit 840343f

Please sign in to comment.
Something went wrong with that request. Please try again.