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

Comment content extra slashed #97

Closed
kraftbj opened this Issue Jun 27, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@kraftbj

kraftbj commented Jun 27, 2017

Editing a comment with an apostrophe with this plugin active will extra slash it, e.g. I'll see you later becomes I\'ll see you later.

Haven't tracked down to where this is happening yet.

@kraftbj

This comment has been minimized.

Show comment
Hide comment
@kraftbj

kraftbj Jun 27, 2017

It's apparently coming from $commentdata = array_merge( $commentdata, $commentarr ); in the enhance function ( https://github.com/pfefferle/wordpress-semantic-linkbacks/blob/master/includes/class-linkbacks-handler.php#L83 ) when firing on the wp_update_comment_data filter.

Updating it to $commentdata = array_merge( $commentdata, wp_unslash( $commentarr ) ); resolves it. I haven't read through to understand why that merge is taking place though and why we're merging new processed data with new raw data.

Thoughts?

kraftbj commented Jun 27, 2017

It's apparently coming from $commentdata = array_merge( $commentdata, $commentarr ); in the enhance function ( https://github.com/pfefferle/wordpress-semantic-linkbacks/blob/master/includes/class-linkbacks-handler.php#L83 ) when firing on the wp_update_comment_data filter.

Updating it to $commentdata = array_merge( $commentdata, wp_unslash( $commentarr ) ); resolves it. I haven't read through to understand why that merge is taking place though and why we're merging new processed data with new raw data.

Thoughts?

@asuh

This comment has been minimized.

Show comment
Hide comment
@asuh

asuh Oct 4, 2017

I believe I'm having the same issue but with double quotation marks.

Using the built-in commenting system, comments are adding the backslash character to double quotation marks. I am using WordPress 4.8.2 and Semantic Linkbacks Version 3.4.0.

On the website with this plugin activated, someone goes to a blog post and writes a comment with a set of double quotations. When they submit the comment, the page reloads and shows the comment including backslashes for each double quotation used.

When going to the Dashboard Comments section to manipulate or approve the comment, I edit the comment to delete the backslashes. When I save the corrected comment without the backslashes, on reload it shows the same backslashes that I deleted added back in. If I edit the comment again and make no changes, I then see a total of three backslashes per double quotation. Same process then shows five backslashes. And so on.

The only resolution is the deactivate the plugin.

I haven't tested the above suggested fix but if that works I'd be happy to submit a pull request.

asuh commented Oct 4, 2017

I believe I'm having the same issue but with double quotation marks.

Using the built-in commenting system, comments are adding the backslash character to double quotation marks. I am using WordPress 4.8.2 and Semantic Linkbacks Version 3.4.0.

On the website with this plugin activated, someone goes to a blog post and writes a comment with a set of double quotations. When they submit the comment, the page reloads and shows the comment including backslashes for each double quotation used.

When going to the Dashboard Comments section to manipulate or approve the comment, I edit the comment to delete the backslashes. When I save the corrected comment without the backslashes, on reload it shows the same backslashes that I deleted added back in. If I edit the comment again and make no changes, I then see a total of three backslashes per double quotation. Same process then shows five backslashes. And so on.

The only resolution is the deactivate the plugin.

I haven't tested the above suggested fix but if that works I'd be happy to submit a pull request.

@dshanske

This comment has been minimized.

Show comment
Hide comment
@dshanske

dshanske Oct 4, 2017

First, did you try 3.5.1?

dshanske commented Oct 4, 2017

First, did you try 3.5.1?

@asuh

This comment has been minimized.

Show comment
Hide comment
@asuh

asuh Oct 4, 2017

@dshanske I only saw the upgrade to 3.5.1 since I posted the above comment so I upgraded and tried it. I now cannot reproduce this issue so I assume it was fixed with one of the last versions. As long as @kraftbj verifies the same fix, I think this issue is resolved.

asuh commented Oct 4, 2017

@dshanske I only saw the upgrade to 3.5.1 since I posted the above comment so I upgraded and tried it. I now cannot reproduce this issue so I assume it was fixed with one of the last versions. As long as @kraftbj verifies the same fix, I think this issue is resolved.

@chrisaldrich

This comment has been minimized.

Show comment
Hide comment
@chrisaldrich

chrisaldrich Oct 6, 2017

I just upgraded and can confirm that this is fixed on my site now as well. Thanks folks!

chrisaldrich commented Oct 6, 2017

I just upgraded and can confirm that this is fixed on my site now as well. Thanks folks!

@pfefferle pfefferle closed this Oct 9, 2017

@pfefferle

This comment has been minimized.

Show comment
Hide comment
@pfefferle

pfefferle Oct 9, 2017

Owner

so I close this for now... please reopen if issue still exists...

Owner

pfefferle commented Oct 9, 2017

so I close this for now... please reopen if issue still exists...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment