From 73b14686fc7f2ac028af4e8366e7d3882d2894a8 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Thu, 30 Oct 2014 07:51:53 -0400 Subject: [PATCH] Fix possible issues in skin/skin_path config handling (#1490125) --- program/include/rcmail_output_html.php | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index 0af7fab..7a0992f 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -168,6 +168,8 @@ $valid = !$skin; } + $skin_path = rtrim($skin_path, '/'); + $this->config->set('skin_path', $skin_path); $this->base_path = $skin_path; @@ -870,16 +872,16 @@ $attrib['name'] = $this->eval_expression($attrib['expression']); if ($attrib['name'] || $attrib['command']) { - // @FIXME: 'noshow' is useless, remove? - if ($attrib['noshow']) { - return ''; - } - $vars = $attrib + array('product' => $this->config->get('product_name')); unset($vars['name'], $vars['command']); $label = $this->app->gettext($attrib + array('vars' => $vars)); $quoting = !empty($attrib['quoting']) ? strtolower($attrib['quoting']) : (rcube_utils::get_boolean((string)$attrib['html']) ? 'no' : ''); + + // 'noshow' can be used in skins to define new labels + if ($attrib['noshow']) { + return ''; + } switch ($quoting) { case 'no': @@ -1629,6 +1631,12 @@ $out .= $input_host->show(); } + if (rcube_utils::get_boolean($attrib['submit'])) { + $submit = new html_inputfield(array('type' => 'submit', 'id' => 'rcmloginsubmit', + 'class' => 'button mainaction', 'value' => $this->app->gettext('login'))); + $out .= html::p('formbuttons', $submit->show()); + } + // surround html output with a form tag if (empty($attrib['form'])) { $out = $this->form_tag(array('name' => $form_name, 'method' => 'post'), $out); @@ -1691,9 +1699,9 @@ // add form tag around text field if (empty($attrib['form'])) { $out = $this->form_tag(array( - 'name' => "rcmqsearchform", + 'name' => "rcmqsearchform", 'onsubmit' => self::JS_OBJECT_NAME . ".command('search'); return false", - 'style' => "display:inline"), + 'style' => "display:inline"), $out); } -- Gitblit v1.9.1