Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grav 1.7.42 crashes in Grav\Common\Utils isDangerousFunction - strtolower #3727

Closed
softyde opened this issue Jun 15, 2023 · 1 comment
Closed

Comments

@softyde
Copy link

softyde commented Jun 15, 2023

The following Twig expression leads to a crash in Utils.isDangerousFunction

 {% set first_image = p.media.images|filter(i => not(i.filename starts with '___'))|first %}
Bildschirmfoto 2023-06-15 um 16 35 55

Grav 1.7.42

As a workaround I was able to install 1.7.41.2 via direct installation.

@rhukster
Copy link
Member

quick fix would be to wrap that higlighted line in a check:

if (is_string($name)) {
    $name = strtolower($name);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants