From 85a3b3e027d5bdc035b05358c28c8ebe76e712ad Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 29 Nov 2018 10:13:49 -0700 Subject: [PATCH] Fix some PHP 7.2 warnings "PHP Warning: count() Parameter must be an array or object ..." --- api/src/Storage/Customfields.php | 6 +----- api/src/Storage/Merge.php | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/api/src/Storage/Customfields.php b/api/src/Storage/Customfields.php index a8523bf629..bda119b3d2 100755 --- a/api/src/Storage/Customfields.php +++ b/api/src/Storage/Customfields.php @@ -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']['@']); } diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index 5408d7a48f..ee36030cc0 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -780,7 +780,7 @@ abstract class Merge //die("
".htmlspecialchars($content)."
\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