rasteiner / kirbytranslations

MIT License
21 stars 3 forks source link

Escape only single quotes ("'") and backslashes ("\") #6

Closed adangel closed 8 years ago

adangel commented 8 years ago

and leave all other characters untouched.

We are using single quote strings, when we re-generate the language files. So, no other characters need to be escaped.

The old code with addslashes escaped also double-quotes. If you have a language value that is e.g.

l::set('terms', 'Accept our <a href="/terms">terms</a>');

After saving with static-translations, this was transformed into

l::set('terms', 'Accept our <a href=\"/terms\">terms</a>');

and the link was broken...

With this fix, all my current language values are not changed when I re-save them with static-translations.