php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64042 Post/json_decode
Submitted: 2013-01-21 22:09 UTC Modified: 2013-01-22 07:37 UTC
From: andreyp at dukascopy dot com Assigned:
Status: Not a bug Package: FPM related
PHP Version: 5.3.21 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andreyp at dukascopy dot com
New email:
PHP Version: OS:

 

 [2013-01-21 22:09 UTC] andreyp at dukascopy dot com
Description:
------------
Simple script give different result under php-fastcgi and php-fpm with apache2.



Test script:
---------------
<?php
$data = $_POST["data"];
var_dump($data);
$data = json_decode($data);
var_dump($data);
?>

result with php-fastcgi
 curl -k https://localhost/json-test.php -X POST -d data=[{\"datumType\":\"message\"}]
string(25) "[{"datumType":"message"}]"
array(1) {
  [0]=>
  object(stdClass)#1 (1) {
    ["datumType"]=>
    string(7) "message"
  }
}

result with php-fpm
curl -k https://localhost/json-test.php -X POST -d data=[{\"datumType\":\"message\"}]
string(29) "[{\"datumType\":\"message\"}]"
NULL


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-22 00:31 UTC] aharvey@php.net
Can you please check phpinfo() on both installations — specifically, does the FPM installation have magic_quotes_gpc enabled?
 [2013-01-22 00:31 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2013-01-22 07:34 UTC] andreyp at dukascopy dot com
You right. On FPM magic_quotes_gpc was enabled. After disable magic_quotes_gpc it 
work.
 [2013-01-22 07:34 UTC] andreyp at dukascopy dot com
-Status: Feedback +Status: Open
 [2013-01-22 07:37 UTC] aharvey@php.net
Thanks!
 [2013-01-22 07:37 UTC] aharvey@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC