aboutsummaryrefslogtreecommitdiffstats
path: root/ws.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-12-05 09:09:55 +0000
committerplegall <plg@piwigo.org>2011-12-05 09:09:55 +0000
commitcdf47f824cf59a490d8a054dc7e8e349e705b465 (patch)
tree62b28f0b8ad69c4ec6a1e8688a2d4e348361a239 /ws.php
parent489beffd6e849c5b88dc967c07e68a816e9578e2 (diff)
merge r12694 from branch 2.3 to trunk
bug 2529 fixed: Piwigo API can only handle the "rest" requestFormat. If we try to search for another request format the only result is an "Unknown request format" error for the client. This error happens when always_populate_raw_post_data is On (which is not the default Apache setting). git-svn-id: http://piwigo.org/svn/trunk@12695 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'ws.php')
-rw-r--r--ws.php18
1 files changed, 1 insertions, 17 deletions
diff --git a/ws.php b/ws.php
index d963a592f..81af4bb04 100644
--- a/ws.php
+++ b/ws.php
@@ -507,7 +507,7 @@ add_event_handler('ws_add_methods', 'ws_addDefaultMethods');
add_event_handler('ws_invoke_allowed', 'ws_isInvokeAllowed', EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
-$requestFormat = null;
+$requestFormat = 'rest';
$responseFormat = null;
if ( isset($_GET['format']) )
@@ -515,22 +515,6 @@ if ( isset($_GET['format']) )
$responseFormat = $_GET['format'];
}
-if ( isset($HTTP_RAW_POST_DATA) )
-{
- $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
- if ( strncmp($HTTP_RAW_POST_DATA, '<?xml', 5) == 0 )
- {
- }
- else
- {
- $requestFormat = "json";
- }
-}
-else
-{
- $requestFormat = "rest";
-}
-
if ( !isset($responseFormat) and isset($requestFormat) )
{
$responseFormat = $requestFormat;