-
Notifications
You must be signed in to change notification settings - Fork 984
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
Javascript quotes missing #9892
Comments
can you please put the link for the page that is generating this errors? |
Right, I got it: the _ob wrappers require php-zlib for ob_gzhandler(), and they silently fail if it is absent. So far I identified the following required modules: php-mysqli, php-mbstring, php-gd, php-zlib. The installer could look for them in the Check list. If you are okay with that, I can craft a patch. |
It should be possible to resolve that difficulty by escaping the existing quotes first. For example, let's say we have some JavaScript which tries to define a variable, but is missing some necessary quotes, like this: var some_variable = Hello there. The cat said "Meow". The dog said "Woof". She's here. He's there. Blah blah blah. We could fix it like this: var some_variable = "Hello there. The cat said \"Meow\". The dog said \"Woof\". She's here. He's there. Blah blah blah." Or like this (depending on whether single or double quotes are preferred in whatever the relevant context is): var some_variable = 'Hello there. The cat said "Meow". The dog said "Woof". She\'s here. He\'s there. Blah blah blah.' |
Bottom line: php-zlib is required, and strange bugs like this one appear if it is missing. |
Describe the bug
Home page (and many others) contains the following JS code:
var avideoModalIframeFullScreenCloseButton = <button type="button" id="avideoModalIframeFullScreenCloseButton" (...)
The string is not quoted and this cause parse errors. Fixing it is hard, because it contains both simple quotes and double quotes. A missed attempt was done in view/include/head.php by wrapping the getHamburgerButton() call by json_encode(). This cannot work because getHamburgerButton() outputs the code instead of returning it.
I have not yet found a reasonably intrusive way of fixing this. I am willing to help, but this requires maintainer insight.
To Reproduce
Expected behavior
avideoModalIframeFullScreenCloseButton value should be double-quoted and the inner quotes should be properly escaped.
Error Logs
Browser console says:
Uncaught SyntaxError: expected expression, got '<'
Screenshots
None
Desktop (please complete the following information):
All
Smartphone (please complete the following information):
All
Additional context
None
The text was updated successfully, but these errors were encountered: