api.php Fails to Parse XML Data

Bug #1262412 reported by ara642040
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Little Software Stats
Fix Committed
Wishlist
Nick

Bug Description

When sending XML data via POST request, api.php generates a "-9 => 'Invalid JSON/XML string'" error. I believe that this is because simply calling out $_POST['data'] does not properly parse the XML data into key=>value pairs.

Adding the following code prior to using the $_POST variable fixes this issue:

if ( $type == 'xml')
 $_POST['data'] = trim(file_get_contents('php://input'));

Nick (ub3rst4r)
Changed in lilsoftstats:
importance: Undecided → Wishlist
status: New → Fix Committed
assignee: nobody → Nick (ub3rst4r)
milestone: none → v0.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.