Support » Plugin: Phoenix Media Rename » PHP 7.2.x: Parameter must be an array or an object that implements Countable

  • Resolved alx359

    (@alx359)


    The working environment is WAMP/PHP7.2.4. I’m getting the following message during rename:
    PHP Warning: count(): Parameter must be an array or an object that implements Countable in \plugins\phoenix-media-rename\class-media-rename.php on line 392

    Changing the concerning line from this:
    if (!is_scalar($subj) && count($subj)) {
    to this:
    if ( !is_scalar($subj) && ($subj instanceof Countable) && count($subj) ) {
    seems to fix the issue for me.
    Thank you.

    UPDATE: the traffic was huge and missed a case. Now should work better. Tested with PHP5.6.35 and PHP7.2.4

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author crossi72

    (@crossi72)

    Hi @alx359,
    I’ sorry but I’ve been very busy so I can only reply now.

    I’ll check as soon as possible on my development server and I will release a patch if needed.

    Thanks for your feedback
    C.

    I can confirm the above warning under PHP 7.2.12

    Plugin Author crossi72

    (@crossi72)

    Hi all,
    excuse me if I made you wait but I have just returned to Italy, I had a busy period.

    I released version 1.3.2 that address the above issue, let me know if you find other problems.

    Thank you for your help.
    C.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP 7.2.x: Parameter must be an array or an object that implements Countable’ is closed to new replies.