Summary | count(): Parameter must be an array or an object that implements Countable on line 980 of Compose.php |
Queue | IMP |
Queue Version | 6.2.24 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | mmarx (at) netdmon (dot) de |
Created | 09/03/2019 (2128 days ago) |
Due | |
Updated | 12/05/2019 (2035 days ago) |
Assigned | |
Resolved | 12/05/2019 (2035 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Assigned to Michael Rubinsky
State ⇒ Resolved
commit 52ebc72bdc21523488102558b949ff31df80cd51
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Thu, 05 Dec 2019 17:19:47 -0500
Bug: 14950Avoid PHP warning from is_array on potentially empty value.M lib/Compose.php
https://github.com/horde/imp/commit/52ebc72bdc21523488102558b949ff31df80cd51
I had the same error and created this small patch:
diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php
index fca3a4d..4c48cf5 100755
--- a/imp/lib/Compose.php
+++ b/imp/lib/Compose.php
@@ -977,7 +977,7 @@ class IMP_Compose implements ArrayAccess,
Countable, IteratorAggregate
($prefs->isLocked('save_sent_mail') &&
$prefs->getValue('save_sent_mail')))) {
/* Keep Bcc: headers on saved messages. */
- if (count($header['bcc'])) {
+ if (is_array($header['bcc']) && count($header['bcc'])) {
$headers->addHeader('Bcc', $header['bcc']);
}
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ count(): Parameter must be an array or an object that implements Countable on line 980 of Compose.php
Type ⇒ Bug
State ⇒ Unconfirmed
I'm not sure if it is related to PHP 7.3 but since I updated, I'm
seeing the following errors when composing/sending mail.
2019-09-03T10:35:33+02:00 WARN: HORDE [imp] PHP ERROR: count():
Parameter must be an array or an object that implements Countable [pid
833 on line 980 of "/usr/share/horde/imp/lib/Compose.php"]
$ php --version
PHP 7.3.9 (cli) (built: Aug 27 2019 22:52:39) ( NTS )
$ pear list -c pear.horde.org | grep imp
imp 6.2.24 stable
Kind Regards
Matthias Marx