Web services


First all, sorry for my English. I'm not English spoken.

I'm working in a page with Elgg. In the page I have several web services published.

with exposed methods like this:

public static methodone($one, $two, $three, $four) {



When I define the fields for my method, I want that the default value for $two is null. But when I made this and send a petition for my web services without value for $two, the value of $three is set in $two, and the value of $four in $three.

I find a solution for this.

In the file https://github.com/Elgg/Elgg/blob/1.9/mod/web_services/lib/web_services.php I add in this line 



$param = get_input($k); // Make things go through the sanitiser

// Always set a value

$sanitised[$k] = null;
if ($param !== null) {
    $sanitised[$k] = $param;
} else {
    // parameter was not passed so check for default
    if (isset($v['default'])) {
        $sanitised[$k] = $v['default'];

And in this line https://github.com/Elgg/Elgg/blob/1.9/mod/web_services/lib/web_services.php#L243

I add this:

//With this if the value not is sended put a null value

if (!isset($parameters[$key])) {
    $serialised_parameters .= ", null " ;

I think that whit this few changes we can send for a parameter a null value and empty value "".

What do you think about this?