Skip to content

PHP ERROR: Array to string conversion [pid 91211 on line 744 of "/var/www/horde6rc/vendor/horde/imap_client/lib/Horde/Imap/Client/Base.php"] #94

Closed

Description

@powercycle

@TDannhauer , @ralflang , The error,

PHP ERROR: Array to string conversion [pid 91211 on line 744 of "/var/www/horde6rc/vendor/horde/imap_client/lib/Horde/Imap/Client/Base.php"]

shows up in the log without any noticeable side affects.

Activity

  1. TDannhauer commented on Jul 20, 2026

    @TDannhauer
    Contributor

    Thanks for the report.

    Cause

    The warning is raised in Horde_Imap_Client_Base::getNamespaces() (horde/imap_client), not in IMP itself:

    $additional = array_map('strval', $additional);

    IMP always forwards the backend namespace setting from backends.php / backends.local.php as that $additional argument. strval() on a nested array value triggers PHP’s “Array to string conversion” warning (and turns the value into the literal string "Array").

    That matches “shows up in the log without any noticeable side effects”: the bogus "Array" name is probed as an unadvertised namespace, does not match anything useful, and is otherwise ignored — but the warning is logged on every call because the strval runs before the namespace cache lookup.

    Documented shape for the IMP backend option is a flat list of UTF-8 strings, e.g.:

    'namespace' => array('#shared/', '#news/', '#public/'),

    A nested / associative form such as '#shared/' => array('delimiter' => '/') (or any other non-string element) is enough to produce this warning.

    Workaround

    Please check the 'namespace' entry in your IMP backends.local.php and reduce it to a flat list of strings as above (or remove the option if you do not need extra unadvertised namespaces). That should stop the log spam immediately.

    If you can paste the 'namespace' => … snippet (redact host/credentials), that would confirm the diagnosis.

    Fix

    We are hardening getNamespaces() in horde/imap_client so non-scalar / non-Stringable $additional entries are skipped instead of being passed to strval(), and correcting a related bug that compared namespace name lengths (strlen) instead of names when filtering already-detected namespaces.

  2. TDannhauer commented on Jul 20, 2026

    @TDannhauer
    Contributor

    Upstream fix: horde/Imap_Client#48

  3. TDannhauer commented on Jul 20, 2026

    @TDannhauer
    Contributor

    @powercycle please test horde/Imap_Client#48 before correcting your config

  4. powercycle commented on Jul 21, 2026

    @powercycle
    Author

    @TDannhauer , just as an additional note, my backends is the same as the distribution, I've made no specific changes. I'll test this soon.

  5. powercycle commented on Jul 22, 2026

    @powercycle
    Author

    @TDannhauer , this definitely resolved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions