note 93094 added to function.json-decode
| From: | acaele at gmail dot com | Date: | Sun, 23 Aug 2009 08:12:05 +0000 |
| Subject: | note 93094 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159796@lists.php.net to get a copy of this message | ||
Magic Quotes, podrÃa echarte a perder la codificación cuando el json viene de un request.
Para evitar que eso pase, es preferible asegurarse:
<?php
$exp = null;
if (get_magic_quotes_gpc())
$exp = json_decode(stripslashes($_POST["parametro_post_json"]), true);
else
$exp = json_decode($_POST["parametro_post_json"], true);
?>
----
Server IP: 200.6.154.201
Probable Submitter: 190.72.76.238
----
Manual Page -- http://www.php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/93094
Del: integrated -- https://master.php.net/note/delete/93094/integrated
Del: useless -- https://master.php.net/note/delete/93094/useless
Del: bad code -- https://master.php.net/note/delete/93094/bad+code
Del: spam -- https://master.php.net/note/delete/93094/spam
Del: non-english -- https://master.php.net/note/delete/93094/non-english
Del: in docs -- https://master.php.net/note/delete/93094/in+docs
Del: other reasons-- https://master.php.net/note/delete/93094
Reject -- https://master.php.net/note/reject/93094
Search -- https://master.php.net/manage/user-notes.php