From 48721c85ebcfa973ee81719d2467ca80e4253dc9 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 01 May 2026 17:30:03 +0000
Subject: [PATCH] =Edmonton Ink hard test begins! Real testing of the managers and reset routes will commence. So far, just ensuring our classes are all loaded correctly: Site() and its sub-classes Membership, Login, etc. Care should be taken to load conditionally on 'init', as we finish defining most settings by 'plugins_loaded' at priority 5

---
 inc/managers/IconsManager.php |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/inc/managers/IconsManager.php b/inc/managers/IconsManager.php
index ee98705..45890c5 100644
--- a/inc/managers/IconsManager.php
+++ b/inc/managers/IconsManager.php
@@ -44,9 +44,7 @@
 	{
 		$this->source = $source;
 		$this->cache = Cache::for('icons_' . $source, WEEK_IN_SECONDS);
-		$this->style = (array_key_exists('icons', JVB_SITE) && in_array(JVB_SITE['icons'], $this->styles))
-			? JVB_SITE['icons']
-			: 'regular';
+		$this->style = Site::icon();
 
 		$this->addMap();
 
@@ -521,7 +519,7 @@
 	 */
 	public function get(string $name, array $options = []): string
 	{
-		if ($name === '') {
+		if (empty($name)) {
 			//No icon requested
 			return '';
 		}
@@ -699,6 +697,14 @@
 		if (!$style) {
 			$style = $this->style;
 		}
+
+		$icon = $this->map[$icon] ?? $icon;
+
+		// Validate icon exists
+		if (!$this->iconExists($icon, $style)) {
+			error_log('[IconsManager] Icon not found: ' . $icon);
+			return '';
+		}
 		$svg = $this->getEncodedSVG($icon, $style);
 		if ($svg !== '') {
 			return "data:image/svg+xml;base64,{$svg}";

--
Gitblit v1.10.0