• Resolved ewd910

    (@ewd910)


    Hi, getting tons of PHP warnings in my server logs coming from this plugin. The warning is:

    PHP Warning: foreach() argument must be of type array|object, bool given in /var/app/current/wp-content/plugins/nextend-smart-slider3-pro/Nextend/Framework/Cache/CacheImage.php on line 118

    The line in question is in this code block:

    if (!$h || strpos($h[0], '200') !== false) {
        foreach ($h as $k => $v) {
            if (strtolower(trim($k)) == "last-modified") {
                return (new DateTime($v))->getTimestamp();
            }
        }
    }

    So if $h is false, enter the foreach loop? Seems wrong to me, hope this can be fixed soon. Thanks

Viewing 1 replies (of 1 total)
  • Plugin Support Robert

    (@robertnextendweb)

    Hi @ewd910

    Indeed that seems to be the case, so in this case please update this code part

    if (!$h || strpos($h[0], '200') !== false) {

    to this

    if (is_array($h) && strpos($h[0], '200') !== false) {

    And it should work as expected afterwards. We will also include this in the next Smart Slider update.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP bug in CacheImage’ is closed to new replies.