#11 double slashes after quote

closed
nobody
5
2010-04-07
2010-03-26
devclined
No

adfter editing a page
the words with quotes '
are added with auto slashes

example: quotes you'll get
output: quotes you\'ll get

Discussion

  • Richard Bondi

    Richard Bondi - 2010-03-29
    • status: open --> pending
     
  • Richard Bondi

    Richard Bondi - 2010-04-07
    • status: pending --> closed
     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-30

    It's easy to fix, i would suggest it could be added to the config file as a default.
    add the following line to the beginning of both foreach loops:
    if (get_magic_quotes_gpc()) $value = stripslashes($value);

    foreach ($_POST as $key => $value) {
    if (get_magic_quotes_gpc()) $value = stripslashes($value);
    $_POST[$key] = mysql_real_escape_string(str_replace("\\","\\\\",$value));
    }

    and

    foreach ($_GET as $key => $value) {
    if (get_magic_quotes_gpc()) $value = stripslashes($value);
    $_GET[$key] = mysql_real_escape_string(htmlspecialchars ($value,ENT_QUOTES,'UTF-8'));
    }

    That way it doesn't matter if magic quotes are on or not. It will still work the way it was intended.