MDL-21400 fixe null param in js funcion call

This commit is contained in:
Petr Skoda
2010-01-24 19:34:44 +00:00
parent 4222342283
commit 1b4e41af17
+6 -2
View File
@@ -574,8 +574,12 @@ class js_writer {
* @return string JS code fragment
*/
public function function_call($function, array $arguments = null, $delay=0) {
$arguments = array_map('json_encode', $arguments);
$arguments = implode(', ', $arguments);
if ($arguments) {
$arguments = array_map('json_encode', $arguments);
$arguments = implode(', ', $arguments);
} else {
$arguments = '';
}
$js = "$function($arguments);";
if ($delay) {