note 60786 added to function.stripslashes

From: Date: Mon, 16 Jan 2006 16:39:13 +0000
Subject: note 60786 added to function.stripslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-101931@lists.php.net to get a copy of this message
if you want to strip the slashes on your post variables you'd better use function stripslashes_deep from above. Because POST could contain arrays. ie : if ( get_magic_quotes_gpc() ) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = stripslashes_deep($_POST); $_GET = stripslashes_deep($_GET); $_COOKIE = stripslashes_deep($_COOKIE); } ---- Submitter IP: 195.221.21.36 ---- Manual Page -- http://www.php.net/manual/en/function.stripslashes.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60786 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60786&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60786&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101931) next »