diff --git a/CHANGELOG b/CHANGELOG
index 3625309ba..3092a1062 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,7 @@ CHANGELOG Roundcube Webmail
- Plugin API: Add 'render_folder_selector' hook
- Added 'keyservers' option to define list of HKP servers for Enigma/Mailvelope (#6326)
- Redis: Support connection to unix socket
+- Put charset meta specification before a title tag, add page title automatically (#6811)
- Elastic: Add Prev/Next buttons on message page toolbar (#6648)
- Elastic: Close search options on Enter key press in quick-search input (#6660)
- Elastic: Changed read/unread icons (#6636)
diff --git a/plugins/enigma/skins/classic/templates/keycreate.html b/plugins/enigma/skins/classic/templates/keycreate.html
index dd6c46582..d71cf977d 100644
--- a/plugins/enigma/skins/classic/templates/keycreate.html
+++ b/plugins/enigma/skins/classic/templates/keycreate.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/classic/templates/keyimport.html b/plugins/enigma/skins/classic/templates/keyimport.html
index b5925f076..186ebcb59 100644
--- a/plugins/enigma/skins/classic/templates/keyimport.html
+++ b/plugins/enigma/skins/classic/templates/keyimport.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/classic/templates/keyinfo.html b/plugins/enigma/skins/classic/templates/keyinfo.html
index 865c95209..adc7af754 100644
--- a/plugins/enigma/skins/classic/templates/keyinfo.html
+++ b/plugins/enigma/skins/classic/templates/keyinfo.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/classic/templates/keys.html b/plugins/enigma/skins/classic/templates/keys.html
index 366bdccb7..b9865918e 100644
--- a/plugins/enigma/skins/classic/templates/keys.html
+++ b/plugins/enigma/skins/classic/templates/keys.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/classic/templates/keysearch.html b/plugins/enigma/skins/classic/templates/keysearch.html
index 6a45676ed..f762138e7 100644
--- a/plugins/enigma/skins/classic/templates/keysearch.html
+++ b/plugins/enigma/skins/classic/templates/keysearch.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/larry/templates/keycreate.html b/plugins/enigma/skins/larry/templates/keycreate.html
index 66fcfbf42..bbf5d55b4 100644
--- a/plugins/enigma/skins/larry/templates/keycreate.html
+++ b/plugins/enigma/skins/larry/templates/keycreate.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/larry/templates/keyimport.html b/plugins/enigma/skins/larry/templates/keyimport.html
index 0639d1b24..2218a9ada 100644
--- a/plugins/enigma/skins/larry/templates/keyimport.html
+++ b/plugins/enigma/skins/larry/templates/keyimport.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/larry/templates/keyinfo.html b/plugins/enigma/skins/larry/templates/keyinfo.html
index c4c7303b7..5540be191 100644
--- a/plugins/enigma/skins/larry/templates/keyinfo.html
+++ b/plugins/enigma/skins/larry/templates/keyinfo.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/larry/templates/keys.html b/plugins/enigma/skins/larry/templates/keys.html
index a280627fc..7a3fd0554 100644
--- a/plugins/enigma/skins/larry/templates/keys.html
+++ b/plugins/enigma/skins/larry/templates/keys.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/enigma/skins/larry/templates/keysearch.html b/plugins/enigma/skins/larry/templates/keysearch.html
index c989bd360..6dc470792 100644
--- a/plugins/enigma/skins/larry/templates/keysearch.html
+++ b/plugins/enigma/skins/larry/templates/keysearch.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/help/skins/classic/templates/content.html b/plugins/help/skins/classic/templates/content.html
index 40a57ddf6..6189bcb00 100644
--- a/plugins/help/skins/classic/templates/content.html
+++ b/plugins/help/skins/classic/templates/content.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/help/skins/classic/templates/help.html b/plugins/help/skins/classic/templates/help.html
index 00179d5e5..ff0b79240 100644
--- a/plugins/help/skins/classic/templates/help.html
+++ b/plugins/help/skins/classic/templates/help.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/classic/templates/managesieve.html b/plugins/managesieve/skins/classic/templates/managesieve.html
index d676c93c6..7787fb1cd 100644
--- a/plugins/managesieve/skins/classic/templates/managesieve.html
+++ b/plugins/managesieve/skins/classic/templates/managesieve.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/classic/templates/setedit.html b/plugins/managesieve/skins/classic/templates/setedit.html
index c1010cae6..e9387ecae 100644
--- a/plugins/managesieve/skins/classic/templates/setedit.html
+++ b/plugins/managesieve/skins/classic/templates/setedit.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/classic/templates/seteditraw.html b/plugins/managesieve/skins/classic/templates/seteditraw.html
index 8ee656bba..ddecf443e 100644
--- a/plugins/managesieve/skins/classic/templates/seteditraw.html
+++ b/plugins/managesieve/skins/classic/templates/seteditraw.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/classic/templates/vacation.html b/plugins/managesieve/skins/classic/templates/vacation.html
index 26e408eef..a65d913e9 100644
--- a/plugins/managesieve/skins/classic/templates/vacation.html
+++ b/plugins/managesieve/skins/classic/templates/vacation.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/larry/templates/filteredit.html b/plugins/managesieve/skins/larry/templates/filteredit.html
index 43e635915..689384aa8 100644
--- a/plugins/managesieve/skins/larry/templates/filteredit.html
+++ b/plugins/managesieve/skins/larry/templates/filteredit.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/larry/templates/managesieve.html b/plugins/managesieve/skins/larry/templates/managesieve.html
index 08327d7e5..c0d602ced 100644
--- a/plugins/managesieve/skins/larry/templates/managesieve.html
+++ b/plugins/managesieve/skins/larry/templates/managesieve.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/larry/templates/setedit.html b/plugins/managesieve/skins/larry/templates/setedit.html
index 3b8f98b36..bb381adc6 100644
--- a/plugins/managesieve/skins/larry/templates/setedit.html
+++ b/plugins/managesieve/skins/larry/templates/setedit.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/larry/templates/seteditraw.html b/plugins/managesieve/skins/larry/templates/seteditraw.html
index 32128de03..0aaabf909 100644
--- a/plugins/managesieve/skins/larry/templates/seteditraw.html
+++ b/plugins/managesieve/skins/larry/templates/seteditraw.html
@@ -1,7 +1,6 @@
-
diff --git a/plugins/managesieve/skins/larry/templates/vacation.html b/plugins/managesieve/skins/larry/templates/vacation.html
index 26dd2027b..1f067c158 100644
--- a/plugins/managesieve/skins/larry/templates/vacation.html
+++ b/plugins/managesieve/skins/larry/templates/vacation.html
@@ -1,7 +1,6 @@
-
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index cbf668df8..80d3b5527 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -228,9 +228,11 @@ EOF;
/**
* Getter for the current page title
*
+ * @param bool $full Prepend title with product/user name
+ *
* @return string The page title
*/
- protected function get_pagetitle()
+ protected function get_pagetitle($full = true)
{
if (!empty($this->pagetitle)) {
$title = $this->pagetitle;
@@ -245,6 +247,15 @@ EOF;
$title = ucfirst($this->env['task']);
}
+ if ($full) {
+ if ($this->devel_mode && !empty($_SESSION['username'])) {
+ $title = $_SESSION['username'] . ' :: ' . $title;
+ }
+ else if ($prod_name = $this->config->get('product_name')) {
+ $title = $prod_name . ' :: ' . $title;
+ }
+ }
+
return $title;
}
@@ -1374,17 +1385,11 @@ EOF;
$content = html::quote($ver);
}
else if ($object == 'steptitle') {
- $content = html::quote($this->get_pagetitle());
+ $content = html::quote($this->get_pagetitle(false));
}
else if ($object == 'pagetitle') {
- if ($this->devel_mode && !empty($_SESSION['username']))
- $title = $_SESSION['username'].' :: ';
- else if ($prod_name = $this->config->get('product_name'))
- $title = $prod_name . ' :: ';
- else
- $title = '';
- $title .= $this->get_pagetitle();
- $content = html::quote($title);
+ // Deprecated, will be added automatically
+ $content = html::quote($this->get_pagetitle());
}
else if ($object == 'contentframe') {
if (empty($attrib['id'])) {
@@ -1828,20 +1833,6 @@ EOF;
$is_empty = true;
}
- // set default page title
- if (empty($this->pagetitle)) {
- $this->pagetitle = 'Roundcube Mail';
- }
-
- // declare page language
- if (!empty($_SESSION['language'])) {
- $lang = substr($_SESSION['language'], 0, 2);
- $output = preg_replace('/add_script('$(function(){ ' . $this->scripts['docready'] . "\n});", 'foot');
}
- // replace specialchars in content
- $page_title = html::quote($this->pagetitle);
$page_header = '';
$page_footer = '';
+ $meta = '';
+
+ // declare page language
+ if (!empty($_SESSION['language'])) {
+ $lang = substr($_SESSION['language'], 0, 2);
+ $output = preg_replace('/charset)) {
if (!headers_sent()) {
header('Content-Type: text/html; charset=' . $this->charset);
}
- $page_header = ''."\n";
+
+ $meta .= html::tag('meta', array(
+ 'http-equiv' => 'content-type',
+ 'content' => "text/html; charset={$this->charset}",
+ 'nl' => true
+ ));
+ }
+
+ // include page title (after charset specification)
+ $meta .= '' . html::quote($this->get_pagetitle()) . "\n";
+
+ $output = preg_replace('/(]*>)\n*/i', "\\1\n{$meta}", $output, 1, $count);
+ if (!$count) {
+ $page_header .= $meta;
}
// include scripts into header/footer
@@ -1894,7 +1905,7 @@ EOF;
}
$hpos++;
}
- $page_header = "\n$page_title\n$page_header\n\n";
+ $page_header = "\n$page_header\n\n";
}
// add page hader
diff --git a/skins/classic/templates/about.html b/skins/classic/templates/about.html
index f3584589f..e6eb55508 100644
--- a/skins/classic/templates/about.html
+++ b/skins/classic/templates/about.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/addressbook.html b/skins/classic/templates/addressbook.html
index a70fd7221..1a31251a5 100644
--- a/skins/classic/templates/addressbook.html
+++ b/skins/classic/templates/addressbook.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/bounce.html b/skins/classic/templates/bounce.html
index c359a1290..6d281703e 100644
--- a/skins/classic/templates/bounce.html
+++ b/skins/classic/templates/bounce.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/compose.html b/skins/classic/templates/compose.html
index d83e51c42..e688dfefa 100644
--- a/skins/classic/templates/compose.html
+++ b/skins/classic/templates/compose.html
@@ -1,7 +1,6 @@
- ::
diff --git a/skins/classic/templates/contact.html b/skins/classic/templates/contact.html
index 8be112b49..c6b569b30 100644
--- a/skins/classic/templates/contact.html
+++ b/skins/classic/templates/contact.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/contactadd.html b/skins/classic/templates/contactadd.html
index bad6daf28..c9e67bfba 100644
--- a/skins/classic/templates/contactadd.html
+++ b/skins/classic/templates/contactadd.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/contactedit.html b/skins/classic/templates/contactedit.html
index c51cbf296..e848575a1 100644
--- a/skins/classic/templates/contactedit.html
+++ b/skins/classic/templates/contactedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/contactprint.html b/skins/classic/templates/contactprint.html
index d4f52ada1..ec7c00c67 100644
--- a/skins/classic/templates/contactprint.html
+++ b/skins/classic/templates/contactprint.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/contactsearch.html b/skins/classic/templates/contactsearch.html
index b17ab7fca..4e6383b29 100644
--- a/skins/classic/templates/contactsearch.html
+++ b/skins/classic/templates/contactsearch.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/error.html b/skins/classic/templates/error.html
index fdd7c887b..cc84a5c7f 100644
--- a/skins/classic/templates/error.html
+++ b/skins/classic/templates/error.html
@@ -1,7 +1,6 @@
- :: ERROR
diff --git a/skins/classic/templates/folderedit.html b/skins/classic/templates/folderedit.html
index 28b9a5507..dbecd4df8 100644
--- a/skins/classic/templates/folderedit.html
+++ b/skins/classic/templates/folderedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/folders.html b/skins/classic/templates/folders.html
index b4774bdae..8d2b25439 100644
--- a/skins/classic/templates/folders.html
+++ b/skins/classic/templates/folders.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/identities.html b/skins/classic/templates/identities.html
index 60c2dcd55..3be95ad6f 100644
--- a/skins/classic/templates/identities.html
+++ b/skins/classic/templates/identities.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/identityedit.html b/skins/classic/templates/identityedit.html
index 6f661b38f..33a48e32d 100644
--- a/skins/classic/templates/identityedit.html
+++ b/skins/classic/templates/identityedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/importcontacts.html b/skins/classic/templates/importcontacts.html
index ec7d2636f..0f215d4d3 100644
--- a/skins/classic/templates/importcontacts.html
+++ b/skins/classic/templates/importcontacts.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/login.html b/skins/classic/templates/login.html
index 938473956..cc9b3e085 100644
--- a/skins/classic/templates/login.html
+++ b/skins/classic/templates/login.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/mail.html b/skins/classic/templates/mail.html
index 47baa7960..666adf606 100644
--- a/skins/classic/templates/mail.html
+++ b/skins/classic/templates/mail.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/message.html b/skins/classic/templates/message.html
index 1181b4c16..e34ec41e1 100644
--- a/skins/classic/templates/message.html
+++ b/skins/classic/templates/message.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/messageerror.html b/skins/classic/templates/messageerror.html
index 590296c81..200940e06 100644
--- a/skins/classic/templates/messageerror.html
+++ b/skins/classic/templates/messageerror.html
@@ -1,7 +1,6 @@
- ::
diff --git a/skins/classic/templates/messagepart.html b/skins/classic/templates/messagepart.html
index 72653c1e8..e866bb35a 100644
--- a/skins/classic/templates/messagepart.html
+++ b/skins/classic/templates/messagepart.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/messagepreview.html b/skins/classic/templates/messagepreview.html
index 08c4fda02..26efd1e5a 100644
--- a/skins/classic/templates/messagepreview.html
+++ b/skins/classic/templates/messagepreview.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/messageprint.html b/skins/classic/templates/messageprint.html
index 1be4ade35..29740664c 100644
--- a/skins/classic/templates/messageprint.html
+++ b/skins/classic/templates/messageprint.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/plugin.html b/skins/classic/templates/plugin.html
index b9b6ebe85..64a90a227 100644
--- a/skins/classic/templates/plugin.html
+++ b/skins/classic/templates/plugin.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/responseedit.html b/skins/classic/templates/responseedit.html
index 67ba35bac..50f9da71c 100644
--- a/skins/classic/templates/responseedit.html
+++ b/skins/classic/templates/responseedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/responses.html b/skins/classic/templates/responses.html
index 3b362b4a9..5121f1902 100644
--- a/skins/classic/templates/responses.html
+++ b/skins/classic/templates/responses.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/settings.html b/skins/classic/templates/settings.html
index 3099d2cf6..b0d6eca92 100644
--- a/skins/classic/templates/settings.html
+++ b/skins/classic/templates/settings.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/classic/templates/settingsedit.html b/skins/classic/templates/settingsedit.html
index 642eb094e..491ba6f87 100644
--- a/skins/classic/templates/settingsedit.html
+++ b/skins/classic/templates/settingsedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/elastic/templates/includes/layout.html b/skins/elastic/templates/includes/layout.html
index 3bcd4ae8d..d0fbb7bd6 100644
--- a/skins/elastic/templates/includes/layout.html
+++ b/skins/elastic/templates/includes/layout.html
@@ -17,7 +17,6 @@
-
diff --git a/skins/larry/templates/about.html b/skins/larry/templates/about.html
index 6b2d7a598..46d66ea99 100644
--- a/skins/larry/templates/about.html
+++ b/skins/larry/templates/about.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/addressbook.html b/skins/larry/templates/addressbook.html
index a8d4a8cef..357448b14 100644
--- a/skins/larry/templates/addressbook.html
+++ b/skins/larry/templates/addressbook.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/bounce.html b/skins/larry/templates/bounce.html
index 5c6a31ec4..6ec43a4b3 100644
--- a/skins/larry/templates/bounce.html
+++ b/skins/larry/templates/bounce.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/compose.html b/skins/larry/templates/compose.html
index a86124ac5..54c929e51 100644
--- a/skins/larry/templates/compose.html
+++ b/skins/larry/templates/compose.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/contact.html b/skins/larry/templates/contact.html
index 59fe6f79f..b5063eb77 100644
--- a/skins/larry/templates/contact.html
+++ b/skins/larry/templates/contact.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/contactedit.html b/skins/larry/templates/contactedit.html
index d3e85e0e4..54ef16d8a 100644
--- a/skins/larry/templates/contactedit.html
+++ b/skins/larry/templates/contactedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/contactprint.html b/skins/larry/templates/contactprint.html
index 08026029e..b83dcc464 100644
--- a/skins/larry/templates/contactprint.html
+++ b/skins/larry/templates/contactprint.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/contactsearch.html b/skins/larry/templates/contactsearch.html
index da0ae1bf9..9ee180b93 100644
--- a/skins/larry/templates/contactsearch.html
+++ b/skins/larry/templates/contactsearch.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/error.html b/skins/larry/templates/error.html
index 70b69b2df..d05f1650a 100644
--- a/skins/larry/templates/error.html
+++ b/skins/larry/templates/error.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/folderedit.html b/skins/larry/templates/folderedit.html
index 18d246942..31d104251 100644
--- a/skins/larry/templates/folderedit.html
+++ b/skins/larry/templates/folderedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/folders.html b/skins/larry/templates/folders.html
index d7bf2a6e9..0fe018d22 100644
--- a/skins/larry/templates/folders.html
+++ b/skins/larry/templates/folders.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/identities.html b/skins/larry/templates/identities.html
index 436fc4c6c..6f8e24ef2 100644
--- a/skins/larry/templates/identities.html
+++ b/skins/larry/templates/identities.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/identityedit.html b/skins/larry/templates/identityedit.html
index 8d5e62290..2a4d7e9e6 100644
--- a/skins/larry/templates/identityedit.html
+++ b/skins/larry/templates/identityedit.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/importcontacts.html b/skins/larry/templates/importcontacts.html
index 028963a13..53db100a5 100644
--- a/skins/larry/templates/importcontacts.html
+++ b/skins/larry/templates/importcontacts.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/login.html b/skins/larry/templates/login.html
index a3300c211..4568af390 100644
--- a/skins/larry/templates/login.html
+++ b/skins/larry/templates/login.html
@@ -1,7 +1,6 @@
-
diff --git a/skins/larry/templates/mail.html b/skins/larry/templates/mail.html
index 238a0226f..5ef0bc211 100644
--- a/skins/larry/templates/mail.html
+++ b/skins/larry/templates/mail.html
@@ -1,7 +1,6 @@
-
">
diff --git a/plugins/managesieve/skins/larry/templates/forward.html b/plugins/managesieve/skins/larry/templates/forward.html
index cf838076f..a0223d211 100644
--- a/plugins/managesieve/skins/larry/templates/forward.html
+++ b/plugins/managesieve/skins/larry/templates/forward.html
@@ -1,7 +1,6 @@
-