HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] [2.1a] Backslash added? if quotation marks

PamelaPamela ✭✭
edited July 2012 in Feedback

Hi, I 've rencently tried the latest v2.1a (24), great and more :) but...

when I write a new discussion, comment, activity's state, message alert :( then a backslash is added if I use these " and ' quotation marks

do you know why? nobody seems encounter this problem, so may be I need to change something

many thanks in advance

php v5.3.10

Tagged:

Best Answer

  • ToddTodd Vanilla Staff
    Answer ✓

    You've got magic quotes turned on. I've added a fix for this but you can also fix it by adding the following to your php.ini:

    magic_quotes_gpc = Off
    

Answers

  • ToddTodd Vanilla Staff

    We've had one other report for this, but it wasn't as succinct as yours. I'm going to look into it.

  • ToddTodd Vanilla Staff
    Answer ✓

    You've got magic quotes turned on. I've added a fix for this but you can also fix it by adding the following to your php.ini:

    magic_quotes_gpc = Off
    
  • PamelaPamela ✭✭
    edited July 2012

    You've got magic quotes turned on. I've added a fix for this but you can also fix it by adding the following to your php.ini:

    magic_quotes_gpc = Off
    

    yes my magic_quotes_gpc parameter is on, you're right :) then I will try to change it to my php.ini and I will give to you my feedback

    thank you for this quick reply...

  • I'm defintely interested in knowing how this works out. I'm having a related issue, except for me, it's only for posts, and only for text enclosed in [code] tags or within a three-backtick code block, and it's only for double-quotes.

    (This is quite often a problem, as you can imagine, because the kinds of things you usually enclose in code blocks quite often have double-quotes! :) )

  • PamelaPamela ✭✭

    @Todd even if magic_quotes_gpc parameter is off, backslah still added w/ v2.1a25

    but may be, I've missing something ;) only tested locally on a wamp server (not online, runnig on linux)

    Please, could you tell us where I can download your fix, is it available from Github ?

  • PamelaPamela ✭✭

    Pamela said:
    @Todd even if magic_quotes_gpc parameter is off, backslah still added w/ v2.1a25

    @Todd Sorry :) in fact it seems solved now... if magic_quotes_gpc are disabled

  • PamelaPamela ✭✭

    Todd said:
    You've got magic quotes turned on. I've added a fix for this (...)

    @Todd, is it publicly available :) at this time?

    I 've looking for it at Github but nothing found about it :( I can't change my php.ini file with my online web hosting

    many thanks in advance

  • PamelaPamela ✭✭

    May be :) here
    https://github.com/vanillaforums/Garden/commit/fb41b325bed74d18a0660821b4b66b14e96010c8

    I don't understand any of the following php code :) but I will try to copy & paste it

    PS: not "master" but "develop" branch

  • OnlyAnExcuseOnlyAnExcuse ✭✭
    edited November 2012

    I'm having this problem now too. Magic quotes are off via htaccess, but have suddenly stopped working. My web host says the htaccess override and the above workaround should be more than enough to prevent it, and say it is something to do with the script im using. They won't alter it in php.

    Using:

    php_value magic_quotes 0

    php_flag magic_quotes off

    php_value magic_quotes_gpc 0

    php_flag magic_quotes_gpc off

    in .htaccess, both in the site's root directory (which is Wordpress) and vanilla's htaccess (in subdirectory)

  • it seems solved with v2.1a33 in my case, so you could try to upgrade if you 're using a previous version :) but I can't tell to you more about it, sorry

Sign In or Register to comment.