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

Localized text phrase "align_left" breaks javascript code if contains quote #3027

Open
daniol opened this issue Dec 3, 2021 · 1 comment

Comments

@daniol
Copy link

daniol commented Dec 3, 2021

What's happened?

If the the text phrase with var_name="align_left" contains a quote ', the complete site gets unusable because the generated javascript code is broken as it is not escaped with a backslash \'. It produces a hundred of errors that can be seen on the javascript console.

Steps to reproduce:

  1. Add a quote in the phrase var_name="align_left" (see screenshot below)

What's expected?

All localized strings should be properly escaped. Quotes should be escaped with a backslash.

Server information

PHP Version 7.3.28

phpFox version

phpfox 4.8.8 (problem did not exist on previous versions)

Screenshots

Database entry:
alinea

Broken JS code:
htmljscode
Text correctly escaped with backslash marked in blue. Affected text not escaped marked in red (backslash is missing).

Notices

  • Other phrases seem to be correctly escaped (see screenshot above)
  • Other phrases might be also affected?
@harrison05
Copy link
Contributor

Hi @daniol

We will check this issue. Thanks for your report.

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

No branches or pull requests

2 participants