• Hi, I have been tryn to resolve this all night…I keep getting an unwanted \ when comments have a ‘ or” in them. Example…I love your site’s. This is showing as site\’s.

    Has anyone else had this happen or anyone have a fix for me.

    Please…& Thank you,
    Christina

Viewing 5 replies - 1 through 5 (of 5 total)
  • Odd.. I will look into this and see if I can get it to do the same thing.

    Thread Starter designbranders

    (@designbranders)

    It’s working now..Did anyone change anything?

    Justin

    (@justin-dubyah)

    I’m noticing it only happens when I edit the post from the admin side. When a client enters a review from the public side, there are no slashes. When I edit them from the admin side, then the slashes show up.

    Thread Starter designbranders

    (@designbranders)

    Hmm…I did some research a few weeks ago and this was an issue outside of this plug-in more with WP itself…but after reading a number of post it got very confusing and they seemed to be older so I did not know if it had already been corrected in the updated versions of WP.

    I guess for now we have to enter them from the front end, however if we would not be able to edit them from the admin then.
    I looked through all the code and I could not find the problem.

    I will keep you posted if I find a solution.

    Thanks for your help, Please keep in touch and let me know if you figure it out.

    Thanks!

    Justin

    (@justin-dubyah)

    I am having a hard time finding the lines of code that control how a front-end review is submitted and saved into the database, but I found where the review is saved once it’s edited by the admin.

    There are 2 ways to fix (or at least patch) this problem. One is to change the way the review is saved into the database once it’s edited by the admin, and the other is to change the way the review is outputted.

    To change the way the review is saved when the admin modifies it, the code is found in the file wp-customer-reviews-admin.php between lines 822 and 859 (it’s in the function “real_admin_view_reviews” and I’m starting with the “default” section of the switch). Where you see on lines 852 and 858:
    $update_val = mysql_real_escape_string($new_value);
    and
    $update_val = mysql_real_escape_string($val);

    you can add “stripslashes()” to remove the slashes from being saved in the database, so these lines would look like:
    $update_val = mysql_real_escape_string(stripslashes($new_value));
    and
    $update_val = mysql_real_escape_string(stripslashes($val));

    Alternatively, if you just want to remove the slashes when they get outputted, that code is in the file wp-customer-reviews.php at around line 704, which currently says:
    $review->review_text = nl2br($review->review_text);

    You can simply add the “stripslashes()” function to that to get the same effect. I added a new line right above 704 to do this, so now the 2 lines say:

    $review->review_text = stripslashes($review->review_text);
    $review->review_text = nl2br($review->review_text);

    This seems to do the job… no more annoying slashes! Hope this helps, and let me know if you find anything else on how this problem can be fixed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Weird back slash in comments when a ' or" is used on comment text….’ is closed to new replies.