From fb4474aca9f5f56927290828c09407ddba637d8a Mon Sep 17 00:00:00 2001
From: PhilW <roundcube@tehinterweb.co.uk>
Date: Sat, 31 Aug 2013 04:44:50 -0400
Subject: [PATCH] only call config->get() once

---
 program/include/rcmail_output_html.php |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index ebf71cb..6db5593 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -925,16 +925,18 @@
                 else if ($object == 'logo') {
                     $attrib += array('alt' => $this->xml_command(array('', 'object', 'name="productname"')));
 
-                    if (is_array($this->config->get('skin_logo'))) {
-                       if ($logo = $this->config->get('skin_logo')[$this->template_name]) {
-                           $attrib['src'] = $logo;
-                       }
-                       elseif ($logo = $this->config->get('skin_logo')['*']) {
-                           $attrib['src'] = $logo;
-                       }
-                    }
-                    elseif ($logo = $this->config->get('skin_logo')) {
-                        $attrib['src'] = $logo;
+                    if ($logo = $this->config->get('skin_logo')) {
+                        if (is_array($logo)) {
+                            if ($template_logo = $logo[$this->template_name]) {
+                                $attrib['src'] = $template_logo;
+                            }
+                            elseif ($template_logo = $logo['*']) {
+                                $attrib['src'] = $template_logo;
+                            }
+                        }
+                        else {
+                            $attrib['src'] = $logo;
+                        }
                     }
 
                     $content = html::img($attrib);

--
Gitblit v1.9.1