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

Unnecessary stripslashes in format_questiontext()? #8

Closed
ghost opened this issue Jul 31, 2015 · 3 comments
Closed

Unnecessary stripslashes in format_questiontext()? #8

ghost opened this issue Jul 31, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 31, 2015

I noticed that there is a local format_questiontext() in question.php. It just calls the parent function, then calls stripslashes() on the returned question text, which results in the backslashes being removed.
Other question-types don't seem to do this, and backslashes can be useful..
Suggest removing the local function unless there is good reason for it to be there?

@gbateson
Copy link
Owner

Is the use of backslashes() in question.php causing you problems? Could you provide an example of a question for me to test on?

@ghost
Copy link
Author

ghost commented Jul 31, 2015

If you set the question text to: name 2-1 ctest title [AAA\BBBB]
it is displayed as: name 2-1 ctest title [AAABBBB].
(note that if you do the same in the question title, the backslash is preserved)

@gbateson
Copy link
Owner

Thanks very much for supplying the test case. I have removed the unnecessary call to stripslashes() and confirmed that backslashes in the question text are now preserved. Thanks for bringing this issue to my attention.

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

No branches or pull requests

1 participant