diff options
author | Aleksander Machniak <alec@alec.pl> | 2019-11-18 17:51:36 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2019-11-18 17:51:36 +0300 |
commit | 8a25ddbf53fe5ec09edd3ce5b20312cbc5b32d28 (patch) | |
tree | 8d4144bd4248ff42e54cb5afd5f40f916155b98f /program | |
parent | feb4ecdf51a8511b761e142998a5e20510efab7f (diff) |
Update changelog, CS improvements
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcmail_output_html.php | 4 | ||||
-rw-r--r-- | program/lib/Roundcube/html.php | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index ef66dd83d..891a64d84 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -1790,7 +1790,7 @@ EOF; public function add_script($script, $position = 'head') { if (!isset($this->scripts[$position])) { - $this->scripts[$position] = "\n" . rtrim($script); + $this->scripts[$position] = rtrim($script); } else { $this->scripts[$position] .= "\n" . rtrim($script); @@ -1852,7 +1852,7 @@ EOF; // put docready commands into page footer if (!empty($this->scripts['docready'])) { - $this->add_script('$(function(){ ' . $this->scripts['docready'] . "\n});", 'foot'); + $this->add_script("\$(function() {\n" . $this->scripts['docready'] . "\n});", 'foot'); } $page_header = ''; diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php index af61c68e3..9fb3dda1c 100644 --- a/program/lib/Roundcube/html.php +++ b/program/lib/Roundcube/html.php @@ -256,18 +256,21 @@ class html if (is_string($attr)) { $attr = array('src' => $attr); } + if ($cont) { - if (self::$doctype == 'xhtml') - $cont = "\n/* <![CDATA[ */\n" . $cont . "\n/* ]]> */\n"; - else - $cont = "\n" . $cont . "\n"; + if (self::$doctype == 'xhtml') { + $cont = "/* <![CDATA[ */\n{$cont}\n/* ]]> */"; + } + + $cont = "\n{$cont}\n"; } - if (self::$doctype == 'xhtml') + if (self::$doctype == 'xhtml') { $attr += array('type' => 'text/javascript'); + } return self::tag('script', $attr + array('nl' => true), $cont, - array_merge(self::$common_attrib, array('src','type','charset'))); + array_merge(self::$common_attrib, array('src', 'type', 'charset'))); } /** |