From 197203727417a03d87053a47e5aa5175a76e3e0b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Thu, 17 Oct 2013 04:24:53 -0400 Subject: [PATCH] Fix vulnerability in handling _session argument of utils/save-prefs (#1489382) --- program/include/rcube_json_output.php | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php index efb6728..ade9cc0 100644 --- a/program/include/rcube_json_output.php +++ b/program/include/rcube_json_output.php @@ -75,7 +75,11 @@ */ public function set_pagetitle($title) { - $name = $this->config->get('product_name'); + if ($this->config->get('devel_mode') && !empty($_SESSION['username'])) + $name = $_SESSION['username']; + else + $name = $this->config->get('product_name'); + $this->command('set_pagetitle', empty($name) ? $title : $name.' :: '.$title); } @@ -170,8 +174,15 @@ public function show_message($message, $type='notice', $vars=null, $override=true, $timeout=0) { if ($override || !$this->message) { + if (rcube_label_exists($message)) { + if (!empty($vars)) + $vars = array_map('Q', $vars); + $msgtext = rcube_label(array('name' => $message, 'vars' => $vars)); + } + else + $msgtext = $message; + $this->message = $message; - $msgtext = rcube_label_exists($message) ? rcube_label(array('name' => $message, 'vars' => $vars)) : $message; $this->command('display_message', $msgtext, $type, $timeout * 1000); } } -- Gitblit v1.9.1