Author: chabotc
Date: Thu May 15 06:01:09 2008
New Revision: 656644

URL: http://svn.apache.org/viewvc?rev=656644&view=rev
Log:
Another magic quotes fix. Thanks rovagnati for catching it

Modified:
    incubator/shindig/trunk/php/src/gadgets/http/JsonRpcServlet.php

Modified: incubator/shindig/trunk/php/src/gadgets/http/JsonRpcServlet.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/http/JsonRpcServlet.php?rev=656644&r1=656643&r2=656644&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/http/JsonRpcServlet.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/http/JsonRpcServlet.php Thu May 15 
06:01:09 2008
@@ -55,7 +55,11 @@
                        // we support both a raw http post (without 
application/x-www-form-urlencoded headers) like java does
                        // and a more php / curl safe version of a form post 
with 'request' as the post field that holds the request json data
                        if (isset($GLOBALS['HTTP_RAW_POST_DATA']) || 
isset($_POST['request'])) {
-                               $request = 
json_decode(isset($GLOBALS['HTTP_RAW_POST_DATA']) ? 
$GLOBALS['HTTP_RAW_POST_DATA'] : $_POST['request']);
+                               $requestParam = 
isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : 
$_POST['request'];
+                               if (get_magic_quotes_gpc()) {
+                                       $requestParam = 
stripslashes($requestParam);
+                               }
+                               $request = json_decode($requestParam);
                                if ($request == 
(isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : 
$_POST['request'])) {
                                        throw new Exception("Malformed json 
string");
                                }


Reply via email to