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

Division by zero (PrettyEmbedHelper\Eel\Helper::paddingTop($ratio = null)) #4

Closed
wolfgang-braun opened this issue Jul 31, 2023 · 2 comments

Comments

@wolfgang-braun
Copy link

Hi jonnitto,

thank you for this nice plugin!

Embedding a portrait Youtube video lead to an 500 error.

According to call stack

237 Neos\Eel\CompilingEvaluator_Original::evaluate("Jonnitto.PrettyEmbedHelper.paddingTop(this.ratio || this.force16to9)", Neos\Eel\ProtectedContext)
236 Neos\Eel\Utility_Original::evaluateEelExpression("${Jonnitto.PrettyEmbedHelper.paddingTop(this.ratio || this.force16to9)}", Neos\Eel\CompilingEvaluator, array|37|)

It looks like the bool false gets passed to paddingTop https://github.com/jonnitto/Jonnitto.PrettyEmbedHelper/blob/master/Classes/Eel/Helper.php#L25

And paddingTop doesn't handle this case, casts false to 0 and triggers Division by zero.

Is this a bad configuration or a bug?

Config:

  PrettyEmbedVideoPlatforms:
    defaults:
      lightbox: false
      preserveAspectRatio: false
      force16to9: false

Thank you very much!

@jonnitto
Copy link
Owner

jonnitto commented Aug 4, 2023

This is a bug. Do you want to open a PR?

@jonnitto
Copy link
Owner

jonnitto commented Dec 9, 2023

Closed with #3

@jonnitto jonnitto closed this as completed Dec 9, 2023
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