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

This commit is contained in:
Simon Welsh 2011-10-29 10:49:17 +13:00
parent 75b16f6e1b
commit 840343ffb7
2 changed files with 3 additions and 2 deletions

View File

@ -136,7 +136,8 @@ class SS_Backtrace {
$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 File

@ -319,7 +319,7 @@ class SSViewer {
}
}
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(