diff --git a/lib/file_ui_output.php b/lib/file_ui_output.php
--- a/lib/file_ui_output.php
+++ b/lib/file_ui_output.php
@@ -146,7 +146,7 @@
         }
 
         $this->env['skin_path'] = 'skins/' . $this->skin . '/';
-        $script = '';
+        $script = array();
 
         if (!empty($this->env)) {
             $script[] = 'ui.set_env(' . json_encode($this->env) . ');';
@@ -172,7 +172,7 @@
         }
 
         $this->tpl->assign('skin_path', $this->env['skin_path']);
-        if ($script) {
+        if (!empty($script)) {
             $script = "<script type=\"text/javascript\">\n" . implode("\n", $script) . "\n</script>";
             $this->tpl->assign('script', $script);
         }