Skip to content

Commit

Permalink
merge r12694 from branch 2.3 to trunk
Browse files Browse the repository at this point in the history
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
  • Loading branch information
plegall committed Dec 5, 2011
1 parent 489beff commit cdf47f8
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions ws.php
Expand Up @@ -507,30 +507,14 @@ function ws_addDefaultMethods( $arr )

add_event_handler('ws_invoke_allowed', 'ws_isInvokeAllowed', EVENT_HANDLER_PRIORITY_NEUTRAL, 3);

$requestFormat = null;
$requestFormat = 'rest';
$responseFormat = null;

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;
Expand Down

0 comments on commit cdf47f8

Please sign in to comment.