Bug #68491 [NEW]: abount stripcslashes
From: 328060173 at qq dot com
Operating system: window 2010
PHP version: 5.4.35
Package: Strings related
Bug Type: Bug
Bug description:abount stripcslashes
Description:
------------
//Why the php5.4 does not require stripcslashes function, need and in
PHP 5.2??
php 5.4
<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");
//è·å请æ±åæ°
$req = $_REQUEST["req"];
//廿忿
//$req = stripcslashes ( $req );
$arr = json_decode ( $req, true );
print_r($arr);
?>
php 5.2
php 5.4
<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");
//è·å请æ±åæ°
$req = $_REQUEST["req"];
//廿忿
//$req = stripcslashes ( $req );
$arr = json_decode ( $req, true );
print_r($arr);
?>
Test script:
---------------
http://localhost:8080?req={"test":"?","loc":"{"province":"hanzhou"}"}
php 5.4
<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");
//è·å请æ±åæ°
$req = $_REQUEST["req"];
//廿忿
//$req = stripcslashes ( $req );
$arr = json_decode ( $req, true );
print_r($arr);
?>
php 5.2
php 5.4
<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");
//è·å请æ±åæ°
$req = $_REQUEST["req"];
//廿忿
//$req = stripcslashes ( $req );
$arr = json_decode ( $req, true );
print_r($arr);
?>
Expected result:
----------------
return array
Actual result:
--------------
nothing return
--
Edit bug report at https://bugs.php.net/bug.php?id=68491&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68491&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68491&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68491&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68491&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68491&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68491&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68491&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68491&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68491&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68491&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68491&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68491&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68491&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68491&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68491&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68491&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68491&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68491&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68491&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68491&r=mysqlcfg
Thread (2 messages)
- 328060173 at qq dot com