From 339b0db3b627ed2ec6ef0511b0f5a6a6a335c4b7 Mon Sep 17 00:00:00 2001
From: Mark Carver <mark.carver@me.com>
Date: Wed, 16 May 2018 21:37:50 -0500
Subject: [PATCH] Issue #2973454 by markcarver: Logo and favicon values should
 be absolute URLs

---
 tag1quo.module | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/tag1quo.module b/tag1quo.module
index e184d9c..0304945 100644
--- a/tag1quo.module
+++ b/tag1quo.module
@@ -111,7 +111,7 @@ function tag1quo_cron() {
  * Return an array of all tracked data.
  */
 function tag1quo_get_status() {
-  global $base_url, $db_url;
+  global $base_url, $db_url, $theme_key;
 
   $status = array();
   $warning = '';
@@ -139,10 +139,22 @@ function tag1quo_get_status() {
   $php_self = isset($_SERVER['PHP_SELF']) ? check_plain($_SERVER['PHP_SELF']) : '';
 
   // Pass along default theme information for optional dashboard display.
-  $default_theme = variable_get('theme_default', 'garland');
-  $default_theme_settings = theme_get_settings($default_theme);
-  $logo_path = $default_theme_settings['default_logo'] ? '' : $default_theme_settings['logo_path'];
-  $favicon_path = $default_theme_settings['default_favicon'] ? '' : $default_theme_settings['favicon_path'];
+  // Unfortunately, in 6.x, theme_get_setting() doesn't allow for a
+  // specific theme key to be passed. Instead, the global $theme_key
+  // must be temporarily overridden to get the same desired effect.
+  $original_theme_key = $theme_key;
+  $theme_key = variable_get('theme_default', 'garland');
+
+  // Retrieve the absolute logo URL.
+  $logo = theme_get_setting('logo');
+  $logo_path = $logo ? url($logo, array('absolute' => TRUE)) : '';
+
+  // Retrieve the absolute favicon URL.
+  $favicon = theme_get_setting('favicon');
+  $favicon_path = $favicon ? url($favicon, array('absolute' => TRUE)) : '';
+
+  // Restore the original theme key.
+  $theme_key = $original_theme_key;
 
   // A hash of the db_url helps identify different deployment instances.
   if (is_array($db_url)) {
-- 
2.15.1

