Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2021-03-15 16:12:37 +0300
committerAleksander Machniak <alec@alec.pl>2021-03-15 16:15:04 +0300
commitd0dccc706670f28914a27117b563f82ab5c0360f (patch)
treef61e20a1a6ec68c47e86dab6ce6d40754dd37b69
parentcbb8cfcb29afd7a83a5d08cef1eb7ec2db645abc (diff)
Don't cache disabled_actions setting in memory
If some plugin changed the setting after first button() method use, the change would not have been seen in the rest of the method calls.
-rw-r--r--program/include/rcmail_output_html.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 6f252a8d1..76e2c9394 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -1576,8 +1576,7 @@ EOF;
*/
public function button($attrib)
{
- static $s_button_count = 100;
- static $disabled_actions = null;
+ static $s_button_count = 100;
// these commands can be called directly via url
$a_static_commands = array('compose', 'list', 'preferences', 'folders', 'identities');
@@ -1609,9 +1608,7 @@ EOF;
$element = ($this->env['task'] ? $this->env['task'] . '.' : '') . $action;
}
- if ($disabled_actions === null) {
- $disabled_actions = (array) $this->config->get('disabled_actions');
- }
+ $disabled_actions = (array) $this->config->get('disabled_actions');
// remove buttons for disabled actions
if (in_array($element, $disabled_actions) || in_array($action, $disabled_actions)) {