Login Register

PHP syntax error in one of dijit files?

I just got acquainted with dojo yesterday, it caught my interest, so I started reading on the manual. Today I've started to create my first project, as my IDE (Eclipse) pointed to an error in one of php-files.
It's the file %DOJO_ROOT%/dijit/bench/benchReceive.php

Symbol "}" on line 124 or 125 should be removed, since one of them is unnecessary.
In case you need full function syntax:

function add_rec($table, $data) {

        if (!is_array($data)) { return FALSE; }

        $keys = array_keys($data);
        $values = array_values($data);
        $field=0;

        for ($field;$field<sizeof($data);$field++) {
                if (!ereg("^[0-9].*$",$keys[$field])) {
                        $sqlfields = $sqlfields.$keys[$field]."=\"".$values[$field]."\", ";
         }
        }
        $sqlfields = (substr($sqlfields,0,(strlen($sqlfields)-2)));

        if ($query = mysql_query("insert into $table set $sqlfields")) {
                $id = mysql_insert_id();
                return ($id); } else { return FALSE; }
        }
}

As you can see, last IF statement is already closed right after "return FALSE;", so one of two "}" in last two lines should be taken out.

bug

Submitted #5864 to track this; please feel free to file bugs there. (And if you have fixes that's even better but you need to sign the CLA for anything non-trivial.