diff options
-rw-r--r-- | engine/lib/api.php | 1 | ||||
-rw-r--r-- | engine/tests/services/api.php | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/engine/lib/api.php b/engine/lib/api.php index 7d9791953..9fbca5714 100644 --- a/engine/lib/api.php +++ b/engine/lib/api.php @@ -667,6 +667,7 @@ function serialise_parameters($method, $parameters) { $array = trim($array,","); $array .= ")"; + $array = ",$array"; $serialised_parameters .= $array; break; diff --git a/engine/tests/services/api.php b/engine/tests/services/api.php index 2acda5823..b9dfda8f5 100644 --- a/engine/tests/services/api.php +++ b/engine/tests/services/api.php @@ -264,19 +264,19 @@ class ElggCoreServicesApiTest extends ElggCoreUnitTest { $this->registerFunction(false, false, array('param1' => array('type' => 'array')));
$parameters = array('param1' => array('one', 'two'));
$s = serialise_parameters('test', $parameters);
- $this->assertIdentical($s, "array('0'=>'one','1'=>'two')");
+ $this->assertIdentical($s, ",array('0'=>'one','1'=>'two')");
// associative array of strings
$this->registerFunction(false, false, array('param1' => array('type' => 'array')));
$parameters = array('param1' => array('first' => 'one', 'second' => 'two'));
$s = serialise_parameters('test', $parameters);
- $this->assertIdentical($s, "array('first'=>'one','second'=>'two')");
+ $this->assertIdentical($s, ",array('first'=>'one','second'=>'two')");
// indexed array of strings
$this->registerFunction(false, false, array('param1' => array('type' => 'array')));
$parameters = array('param1' => array(1, 2));
$s = serialise_parameters('test', $parameters);
- $this->assertIdentical($s, "array('0'=>'1','1'=>'2')");
+ $this->assertIdentical($s, ",array('0'=>'1','1'=>'2')");
// test unknown type
$this->registerFunction(false, false, array('param1' => array('type' => 'bad')));
|