From: webjedi at hudzilla dot eclipse dot co dot uk Operating system: Fedora Core 3 PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug description: Add a function like smart_addslashes()?
Description: ------------ Would it be possible to write a function, named something like smart_addslashes(), that only adds slashes to a string if magic_quotes_gpc is disabled? Yes, this is only three lines of userland code: if (!get_magic_quotes_gpc()) { $input_string = addslashes($input_string); } But adding slashes to strings is a common task, and checking whether the string has already been auto-slashed is crucial for portability reasons - trimming three lines down to one would help ease the job a little. Thanks! -- Edit bug report at http://bugs.php.net/?id=30754&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30754&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30754&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30754&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30754&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30754&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30754&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30754&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30754&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30754&r=support Expected behavior: http://bugs.php.net/fix.php?id=30754&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30754&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30754&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30754&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30754&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30754&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30754&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30754&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30754&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30754&r=mysqlcfg