Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 840343ffb771b3c567381928367fdaaa7428c7d4 1 parent 75b16f6
@simonwelsh simonwelsh authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  dev/Backtrace.php
  2. +1 −1  view/SSViewer.php
View
3  dev/Backtrace.php
@@ -136,7 +136,8 @@ static function full_func_name($item, $showArgs = false, $argCharLimit = 10000)
$args = array();
foreach($item['args'] as $arg) {
if(!is_object($arg) || method_exists($arg, '__toString')) {
- $args[] = (strlen((string)$arg) > $argCharLimit) ? substr((string)$arg, 0, $argCharLimit) . '...' : (string)$arg;
+ $sarg = is_array($arg) ? 'Array' : strval($arg);
+ $args[] = (strlen($sarg) > $argCharLimit) ? substr($sarg, 0, $argCharLimit) . '...' : $sarg;
} else {
$args[] = get_class($arg);
}
View
2  view/SSViewer.php
@@ -319,7 +319,7 @@ public function __construct($templateList) {
}
}
- if(substr((string) $templateList,-3) == '.ss') {
+ if(!is_array($templateList) && substr((string) $templateList,-3) == '.ss') {
$this->chosenTemplates['main'] = $templateList;
} else {
$this->chosenTemplates = SS_TemplateLoader::instance()->findTemplates(
Please sign in to comment.
Something went wrong with that request. Please try again.