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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
32 - 13 = ?
Subscribe to this entry?

 
 [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: Tue Apr 23 11:01:33 2024 UTC