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

Add escaping of VPL_COMPILATIONFAILED text in default_evaluate #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Astor-Bizard
Copy link
Contributor

The VPL_COMPILATIONFAILED message is not properly escaped in default_evaluate.sh, leading to simple quotes being removed from the message (which can be the case in some translations).
This fixes the issue.

@jcrodriguez-dis
Copy link
Owner

Dear @Astor-Bizard,

Using the PHP addslashes function instead of the Linux sed command could improve readability and make the code easier to understand for developers familiar with PHP. It may also simplify maintenance by reducing reliance on external command-line utilities.

Let me know your thoughts.

@Astor-Bizard
Copy link
Contributor Author

Hi,

I totally agree about the readability part, the sed escape I wrote really is a nightmare.

However, using addslashes like this:

vpl_bash_export('VPL_COMPILATIONFAILED', addslashes(get_string('VPL_COMPILATIONFAILED', VPL)));

does not work.

Additionnally, I usually prefer to let the code part that actually needs the escaping do the escaping. And in that case, it is the bash script that needs to include this string within both double and simple quotes.

By all means, if you find a way to write a quote escaping that looks less like "backslash hell", please tell me 😄

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

Successfully merging this pull request may close these issues.

2 participants