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

Localizations break when values/keys contain quotes #53

Closed
kix opened this issue Apr 20, 2016 · 0 comments · Fixed by #54
Closed

Localizations break when values/keys contain quotes #53

kix opened this issue Apr 20, 2016 · 0 comments · Fixed by #54

Comments

@kix
Copy link
Contributor

kix commented Apr 20, 2016

Given this:

use Passbook\Pass\Localization;
$localization = new Localization('en');
$localization->addStrings([
    'SOME_FIELD' => 'This "has" "quotes"',
]);

...the expected en.lproj/pass.strings is supposed to have this line:

"SOME_FIELD" = "This \"has \"quotes\"";

...yet the quotes are ignored and the pass.strings file gets malformed, which, in turn, makes a part of the translations invalid:

"SOME_FIELD" = "This "has "quotes"";
"SOME_OTHER_FIELD"="Test test";

If I had some of the fields after this faulty one, those would be broken too. I suggest adding an addslashes() call somewhere, for example in the Localization#getStringsFileOutput() method.

kix added a commit to kix/php-passbook that referenced this issue Apr 20, 2016
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

Successfully merging a pull request may close this issue.

1 participant