Skip to content

Commit

Permalink
fix web service optional array parameters were always transformed to …
Browse files Browse the repository at this point in the history
…arrays

git-svn-id: http://piwigo.org/svn/trunk@21965 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Apr 2, 2013
1 parent 1f9fd21 commit c75ba6b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions include/ws_core.inc.php
Expand Up @@ -412,10 +412,6 @@ function addMethod($methodName, $callback, $params=array(), $description, $inclu
{
$flags |= WS_PARAM_OPTIONAL;
}
if ( $flags & WS_PARAM_FORCE_ARRAY )
{
$flags |= WS_PARAM_ACCEPT_ARRAY;
}
$options['flags'] = $flags;
$params[$param] = $options;
}
Expand Down Expand Up @@ -496,7 +492,7 @@ function invoke($methodName, $params)
else if ( array_key_exists('default',$options) )
{
$params[$name] = $options['default'];
if ( ($flags&WS_PARAM_FORCE_ARRAY) )
if ( ($flags&WS_PARAM_FORCE_ARRAY)==WS_PARAM_FORCE_ARRAY )
{
$this->makeArrayParam( $params[$name] );
}
Expand All @@ -509,7 +505,7 @@ function invoke($methodName, $params)
{
return new PwgError(WS_ERR_INVALID_PARAM, $name.' must be scalar' );
}
if ( ($flags&WS_PARAM_FORCE_ARRAY) )
if ( ($flags&WS_PARAM_FORCE_ARRAY)==WS_PARAM_FORCE_ARRAY )
{
$this->makeArrayParam( $the_param );
}
Expand Down

0 comments on commit c75ba6b

Please sign in to comment.