public static function restoreSlashes($string)
 {
  // Check if "Magic Quotes" is turned on.
  if (get_magic_quotes_gpc())
  {
    // Add escape slashes.
    return addslashes($string);
  }
  // Return a string that has escape slashes.
  return $string;
}

Wrong way around.

If gpc is enabled, then there are already slashes - no need to add them again.

If it's not, you need to addslashes.

if (get_magic_quotes_gpc()) {
  return $string;
}

return addslashes($string);


Though I'm curious why you need to re-add them at all.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to