Merge branch 'master' of github.com:roundcube/roundcubemail

pull/5721/head
Aleksander Machniak 8 years ago
commit a7c43c6e38

@ -27,6 +27,7 @@ CHANGELOG Roundcube Webmail
- Fix XSS issue in handling of a style tag inside of an svg element [CVE-2017-6820] - Fix XSS issue in handling of a style tag inside of an svg element [CVE-2017-6820]
- Fix bug where settings/upload.inc could not be used by plugins (#5694) - Fix bug where settings/upload.inc could not be used by plugins (#5694)
- Fix regression in LDAP fuzzy search where it always used prefix search instead (#5713) - Fix regression in LDAP fuzzy search where it always used prefix search instead (#5713)
- Fix bug where namespace prefix could not be truncated on folders list if show_real_foldernames=true (#5695)
- Fix undesired effects when postgres database uses different timezone than PHP host (#5708) - Fix undesired effects when postgres database uses different timezone than PHP host (#5708)
RELEASE 1.3-beta RELEASE 1.3-beta

@ -1689,12 +1689,13 @@ class rcmail extends rcube
* Try to localize the given IMAP folder name. * Try to localize the given IMAP folder name.
* UTF-7 decode it in case no localized text was found * UTF-7 decode it in case no localized text was found
* *
* @param string $name Folder name * @param string $name Folder name
* @param bool $with_path Enable path localization * @param bool $with_path Enable path localization
* @param bool $path_remove Remove the path
* *
* @return string Localized folder name in UTF-8 encoding * @return string Localized folder name in UTF-8 encoding
*/ */
public function localize_foldername($name, $with_path = false) public function localize_foldername($name, $with_path = false, $path_remove = false)
{ {
$realnames = $this->config->get('show_real_foldernames'); $realnames = $this->config->get('show_real_foldernames');
@ -1702,12 +1703,20 @@ class rcmail extends rcube
return $this->gettext($folder_class); return $this->gettext($folder_class);
} }
$storage = $this->get_storage();
$delimiter = $storage->get_hierarchy_delimiter();
// Remove the path
if ($path_remove) {
if (strpos($name, $delimiter)) {
$path = explode($delimiter, $name);
$name = array_pop($path);
}
}
// try to localize path of the folder // try to localize path of the folder
if ($with_path && !$realnames) { else if ($with_path && !$realnames) {
$storage = $this->get_storage(); $path = explode($delimiter, $name);
$delimiter = $storage->get_hierarchy_delimiter(); $count = count($path);
$path = explode($delimiter, $name);
$count = count($path);
if ($count > 1) { if ($count > 1) {
for ($i = 1; $i < $count; $i++) { for ($i = 1; $i < $count; $i++) {

@ -86,20 +86,21 @@ function rcmail_folder_form($attrib)
// Location (name) // Location (name)
if ($options['protected']) { if ($options['protected']) {
$foldername = str_replace($delimiter, ' &raquo; ', rcube::Q($RCMAIL->localize_folderpath($mbox))); $foldername = str_replace($delimiter, ' &raquo; ', rcube::Q($RCMAIL->localize_foldername($mbox, false, true)));
} }
else if ($options['norename']) { else if ($options['norename']) {
$foldername = rcube::Q($folder); $foldername = rcube::Q($folder);
} }
else { else {
if (isset($_POST['_name'])) if (isset($_POST['_name'])) {
$folder = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); $folder = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true));
}
$foldername = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30)); $foldername = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30));
$foldername = $foldername->show($folder); $foldername = $foldername->show($folder);
if ($options['special']) { if ($options['special'] && ($sname = $RCMAIL->localize_foldername($mbox, false, true)) != $folder) {
$foldername .= '&nbsp;(' . rcube::Q($RCMAIL->localize_foldername($mbox)) .')'; $foldername .= '&nbsp;(' . rcube::Q($sname) .')';
} }
} }

@ -277,12 +277,13 @@ function rcmail_subscription_form($attrib)
foreach ($list_folders as $i => $folder) { foreach ($list_folders as $i => $folder) {
$sub_key = array_search($folder['id'], $a_subscribed); $sub_key = array_search($folder['id'], $a_subscribed);
$subscribed = $sub_key !== false; $subscribed = $sub_key !== false;
$protected = $folder['id'] == 'INBOX' || ($protect_default && isset($special_folders[$folder['id']])); $special = $folder['id'] == 'INBOX' || isset($special_folders[$folder['id']]);
$protected = $folder['id'] == 'INBOX' || ($protect_default && $special);
$noselect = false; $noselect = false;
$classes = array(); $classes = array();
$folder_utf8 = rcube_charset::convert($folder['id'], 'UTF7-IMAP'); $folder_utf8 = rcube_charset::convert($folder['id'], 'UTF7-IMAP');
$display_folder = rcube::Q($protected ? $RCMAIL->localize_foldername($folder['id']) : $folder['name']); $display_folder = rcube::Q($special ? $RCMAIL->localize_foldername($folder['id'], false, true) : $folder['name']);
if ($folder['virtual']) { if ($folder['virtual']) {
$classes[] = 'virtual'; $classes[] = 'virtual';

Loading…
Cancel
Save