Browse Source

Fix bug with show_images setting where option 1 and 3 were swapped (#8268)

pull/8503/head
Aleksander Machniak 4 years ago
parent
commit
fdca2a55ed
  1. 4
      CHANGELOG.md
  2. 4
      config/defaults.inc.php
  3. 6
      program/actions/mail/index.php
  4. 2
      program/actions/mail/show.php
  5. 4
      program/actions/settings/index.php

4
CHANGELOG.md

@ -16,8 +16,8 @@
- Fix bug in Larry skin where headers toggle state was reset on full page preview (#8203)
- Fix bug where \u200b characters were added into the recipient input preventing mail delivery (#8269)
- Fix charset conversion errors on PHP < 8 for charsets not supported by mbstring (#8252)
- Fix bug where adding a contact to trusted senders via "Always allow from..." button didn't work
if the contact already existed in Personal addresses (or another default contacts source) (#8264, #8268)
- Fix bug where adding a contact to trusted senders via "Always allow from..." button didn't work (#8264, #8268)
- Fix bug with show_images setting where option 1 and 3 were swapped (#8268)
## Release 1.5.0

4
config/defaults.inc.php

@ -1267,9 +1267,9 @@ $config['prefer_html'] = true;
// Display remote resources (inline images, styles) in HTML messages. Default: 0.
// 0 - Never, always ask
// 1 - Allow from trusted senders
// 1 - Allow from my contacts (all writeable addressbooks + collected senders and recipients)
// 2 - Always allow
// 3 - Allow from my contacts (all writeable addressbooks + collected senders and recipients)
// 3 - Allow from trusted senders only
$config['show_images'] = 0;
// open messages in new window

6
program/actions/mail/index.php

@ -862,12 +862,12 @@ class rcmail_action_mail_index extends rcmail_action
&& $message->has_html_part()
) {
switch ($show_images) {
case 1: // trusted senders only
case 3: // all my contacts
case 3: // trusted senders only
case 1: // all my contacts
if (!empty($message->sender['mailto'])) {
$type = rcube_addressbook::TYPE_TRUSTED_SENDER;
if ($show_images == 3) {
if ($show_images == 1) {
$type |= rcube_addressbook::TYPE_RECIPIENT | rcube_addressbook::TYPE_WRITEABLE;
}

2
program/actions/mail/show.php

@ -263,7 +263,7 @@ class rcmail_action_mail_show extends rcmail_action_mail_index
// add link to save sender in addressbook and reload message
$show_images = $rcmail->config->get('show_images');
if (!empty(self::$MESSAGE->sender['mailto']) && ($show_images == 1 || $show_images == 3)) {
$arg = $show_images == 1 ? rcube_addressbook::TYPE_TRUSTED_SENDER : 'true';
$arg = $show_images == 3 ? rcube_addressbook::TYPE_TRUSTED_SENDER : 'true';
$buttons .= ' ' . html::a([
'href' => "#loadremotealways",
'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('load-remote', $arg)",

4
program/actions/settings/index.php

@ -612,8 +612,8 @@ class rcmail_action_settings_index extends rcmail_action
]);
$input->add($rcmail->gettext('never'), 0);
$input->add($rcmail->gettext('frommycontacts'), 3);
$input->add($rcmail->gettext('fromtrustedsenders'), 1);
$input->add($rcmail->gettext('frommycontacts'), 1);
$input->add($rcmail->gettext('fromtrustedsenders'), 3);
$input->add($rcmail->gettext('always'), 2);
$blocks['main']['options']['show_images'] = [

Loading…
Cancel
Save