• Resolved Recon

    (@recon)


    Is there a way to stop \backslashes being added before ‘ and ” characters? I am using Contact Form 7.

    Thanks ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    You should not be getting those.

    I have code in there that calls stripslashes($value) if get_magic_quotes_gpc().

    Looking at the docs for get_magic_quotes_gpc I see that magic_quotes_sybase can override this. Does that or anything else apply to your configuration?

    Thread Starter Recon

    (@recon)

    They appear in the backend, too.

    I have set up Contact Form 7 so that the data is emailed to me as well as added to the database. The backslashes do not appear in the emailed version but they are saved into the database.

    Is it normal for the backslashes to appear in the backend, or should they not appear anywhere?

    Thread Starter Recon

    (@recon)

    I’ve just found out that my host (Dreamhost) has magic_quotes_gpc OFF by default.

    I also noticed that this function has now been deprecated.

    Point of clarification.
    WordPress always adds magic quotes regardless of PHP server magic_quotes_gpc settings.

    Since 3.0, the magic is now done in wp-includes/load.php
    function wp_magic_quotes()

    It is just one of the quirky things they do to be able to support so many different servers.
    So you should not use if ( get_magic_quotes_gpc() ) in your plugins or you will have unexpected results on the servers with get_magic_quotes_gpc = Off. Just always expect they are on anyway.

    Plugin Author Michael Simpson

    (@msimpson)

    Thanks Mike, that’s a big help.

    I put in the change to always call stripslashes. I have another addition in there also, so I will push version 1.8.7 today.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Escape characters’ is closed to new replies.