Welcome Guest, Not a member yet? Register   Sign In
PHP stripping souble quotes on POST
#1

[eluser]Nathan Pitman (Nine Four)[/eluser]
Has anyone ever experienced a situation where PHP strips double quotes on a POST to a web service? We're running a web service on our server and after a PHP upgrade double quotes in serialized arrays that we are passing in the POST are being stripped... we're using NuSOAP.
#2

[eluser]manilodisan[/eluser]
This forum strips double quotes as well. Are you using CI on your website?
#3

[eluser]Nathan Pitman (Nine Four)[/eluser]
Not in this part of the app, we ended up using an abstracted version of the Active Record Library from CI along with NuSOAP for the web services.

POST from a web page is fine but POST from Flash (in our case) ends up with the double quotes stripped. I think this is somehow related to 'HTTP_RAW_POST_DATA' since we managed a temporary fix by adding:

Code:
$HTTP_RAW_POST_DATA = ereg_replace(""",'"',$HTTP_RAW_POST_DATA);
$HTTP_RAW_POST_DATA = ereg_replace("'","'",$HTTP_RAW_POST_DATA);

...before we pass the POST data to NuSOAP. :/
#4

[eluser]manilodisan[/eluser]
Why not base64_encode it before being sent and decode on the PHP end..?
#5

[eluser]Nathan Pitman (Nine Four)[/eluser]
unfortunately not an option as the software is out there and in circulation so I can't amend how the data is passed from Flash. So far as I'm aware though Flash always url encodes before it posts, the script I have added is forcing PHP to urldecode just the double and single quotes (in theory) before passing to NuSOAP... even though it was working without prior to the upgrade. My hosts seem to have no idea so I might have to chalk this up as an unknown and just be wary of running future PHP upgrades... :/

In the future though I think I will certainly take a more bullet proof approach in how I pass the data!




Theme © iAndrew 2016 - Forum software by © MyBB