note 107529 added to function.mysql-real-escape-string

From: Date: Wed, 15 Feb 2012 17:35:51 +0000
Subject: note 107529 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-186151@lists.php.net to get a copy of this message
This small function walks through a complete array without a "normal" loop and convert all potentially "bad" inputs like $_POST and $_GET to mysql conform strings. function db_conform($s) { if (!is_array($s)) mysql_real_escape_string($s); function db_conform_array_callback(&$item, $key) { echo $key; $item = db_conform($item); } array_walk($s, 'db_conform_array_callback'); return $s; } $_POST = db_conform($_POST); ---- Server IP: 87.106.1.137 Probable Submitter: 79.211.58.209 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php Edit -- https://master.php.net/note/edit/107529 Del: integrated -- https://master.php.net/note/delete/107529/integrated Del: useless -- https://master.php.net/note/delete/107529/useless Del: bad code -- https://master.php.net/note/delete/107529/bad+code Del: spam -- https://master.php.net/note/delete/107529/spam Del: non-english -- https://master.php.net/note/delete/107529/non-english Del: in docs -- https://master.php.net/note/delete/107529/in+docs Del: other reasons-- https://master.php.net/note/delete/107529 Reject -- https://master.php.net/note/reject/107529 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186151) next »