Fix some PHP 7.2 warnings "PHP Warning: count() Parameter must be an array or object ..."

This commit is contained in:
nathangray 2018-11-29 10:13:49 -07:00
parent dba9a76246
commit 85a3b3e027
2 changed files with 2 additions and 6 deletions

View File

@ -216,11 +216,7 @@ class Customfields implements \IteratorAggregate
case 'select':
case 'radio':
if(!$field['values'])
{
error_log("{$field['app']} custom field '{$field['name']}' has no values" );
}
else if (count($field['values']) == 1 && isset($field['values']['@']))
if ($field['values'] && count($field['values']) == 1 && isset($field['values']['@']))
{
$field['values'] = self::get_options_from_file($field['values']['@']);
}

View File

@ -780,7 +780,7 @@ abstract class Merge
//die("<pre>".htmlspecialchars($content)."</pre>\n");
}
list($contentstart,$contentrepeat,$contentend) = preg_split('/\$\$pagerepeat\$\$/',$content,-1, PREG_SPLIT_NO_EMPTY); //get differt parts of document, seperatet by Pagerepeat
if ($mimetype == 'text/plain' && count($ids) > 1)
if ($mimetype == 'text/plain' && $ids && count($ids) > 1)
{
// textdocuments are simple, they do not hold start and end, but they may have content before and after the $$pagerepeat$$ tag
// header and footer should not hold any $$ tags; if we find $$ tags with the header, we assume it is the pagerepeatcontent