Browse Source

Fix invalid onclick handler on the logo image when using non-array skin_logo setting (#8933)

pull/8759/merge
Aleksander Machniak 2 years ago
parent
commit
156e480a26
  1. 1
      CHANGELOG.md
  2. 10
      program/include/rcmail_output_html.php
  3. 2
      tests/Rcmail/OutputHtml.php

1
CHANGELOG.md

@ -23,6 +23,7 @@
- Fix so LDAP VLV option is disabled by default as documented (#8833)
- Fix so an email address with name is supported as input to the managesieve notify :from parameter (#8918)
- Fix Help plugin menu (#8898)
- Fix invalid onclick handler on the logo image when using non-array skin_logo setting (#8933)
## Release 1.6.1

10
program/include/rcmail_output_html.php

@ -1589,10 +1589,10 @@ EOF;
foreach ($this->$source as $name => $vars) {
// $vars can be in many forms:
// - string
// - array('key' => 'val')
// - array(string, string)
// - array(array(), string)
// - array(array('key' => 'val'), array('key' => 'val'))
// - ['key' => 'val']
// - [string, string]
// - [[], string]
// - [['key' => 'val'], ['key' => 'val']]
// normalise this for processing by checking for string array keys
$vars = is_array($vars) ? (count(array_filter(array_keys($vars), 'is_string')) > 0 ? [$vars] : $vars) : [$vars];
@ -2780,7 +2780,7 @@ EOF;
}
}
}
else {
else if ($type != 'link') {
$template_logo = $logo;
}
}

2
tests/Rcmail/OutputHtml.php

@ -60,6 +60,8 @@ class Rcmail_RcmailOutputHtml extends PHPUnit\Framework\TestCase
$set_template->setValue($output, 'mail');
$result = $get_template_logo->invokeArgs($output, ['small']);
$this->assertSame('img00', $result);
$result = $get_template_logo->invokeArgs($output, ['link']);
$this->assertSame(null, $result);
$rcmail->config->set('skin_logo', [
"elastic:login[small]" => "img01",

Loading…
Cancel
Save