809: Added double quotation marks character to Android escape function #627
Conversation
@@ -161,7 +161,7 @@ private function unescape( $string ) { | |||
*/ | |||
protected function escape( $string ) { | |||
$string = addcslashes( $string, "'\n" ); | |||
$string = str_replace( array( '&', '<' ), array( '&', '<' ), $string ); |
toolstack
Dec 29, 2016
Contributor
The escaping should be done on the line above (addcslashes()
).
In addition, do we need to escape \
as well?
The escaping should be done on the line above (addcslashes()
).
In addition, do we need to escape \
as well?
ignaciogs
Jan 11, 2017
Author
Contributor
Hi, I Added a new commit
Hi, I Added a new commit
@@ -161,7 +161,8 @@ private function unescape( $string ) { | |||
*/ | |||
protected function escape( $string ) { | |||
$string = addcslashes( $string, "'\n" ); | |||
$string = str_replace( array( '&', '<', '"' ), array( '&', '<', '\"' ), $string ); | |||
$string = addcslashes( $string, '"' ); |
toolstack
Jan 11, 2017
Contributor
You don't need a second call to addcslashes (it may in fact break things), simply add the double quote to the list of characters to escape (so "'\n" becomes "'\n"").
You don't need a second call to addcslashes (it may in fact break things), simply add the double quote to the list of characters to escape (so "'\n" becomes "'\n"").
@ignaciogs can you update the test data to include the escaped double quotes here: |
|
Closing in favour of #811 which includes updated data. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
No description provided.