mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
fix web service optional array parameters were always transformed to arrays
git-svn-id: http://piwigo.org/svn/trunk@21965 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -412,10 +412,6 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF
|
||||
{
|
||||
$flags |= WS_PARAM_OPTIONAL;
|
||||
}
|
||||
if ( $flags & WS_PARAM_FORCE_ARRAY )
|
||||
{
|
||||
$flags |= WS_PARAM_ACCEPT_ARRAY;
|
||||
}
|
||||
$options['flags'] = $flags;
|
||||
$params[$param] = $options;
|
||||
}
|
||||
@@ -496,7 +492,7 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF
|
||||
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] );
|
||||
}
|
||||
@@ -509,7 +505,7 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user