sal0max / grav-plugin-shortcode-gallery-plusplus

A Shortcode extension to add sweet galleries with a lightbox to your Grav website.
MIT License
33 stars 8 forks source link

Call to undefined function Grav\Plugin\Shortcodes\str_contains() #3

Closed pmoreno-rodriguez closed 3 years ago

pmoreno-rodriguez commented 3 years ago

I'm tryin your plugin and it shows the following error:

Call to undefined function Grav\Plugin\Shortcodes\str_contains(), in line 45

If I comment this code, it works fine:

if (str_contains($content, "<pre>"))
    return "<p style='color: #d40000; font-weight: bold; padding: 1rem 0;'>[Shortcode Gallery++] Error:<br> 
            &gt; Images provided got parsed as code block.<br>
            &gt; Please check your markdown file and make sure the images aren't indented by tab or more than three spaces.</p>";

What's wrong?

sal0max commented 3 years ago

Thanks for the bug report!

The str_contains function is only available since PHP 8. Grav however requires PHP 7.1.3 or higher. So you're probably on PHP 7; and that's the reason for the error.

I will fix this shortly with a PHP 7 compatible solution and you should be good to go. 🙂

sal0max commented 3 years ago

Fixed with 7f963693314b87177cafae62b39fae2fb2c58a06 An update should soon be available via the admin panel.

Please verify the fix and close this issue, if it worked.

pmoreno-rodriguez commented 3 years ago

It's working fine now. Great solution. Thanks for your help.