From 85f64c2addcafbafa79b96d75269df95b5ee7e83 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 18 Jan 2026 12:33:18 -0800 Subject: [PATCH] Fix brand color save - escape hash symbol in CFML Use chr(35) instead of # literal to avoid CFML variable interpolation Co-Authored-By: Claude Opus 4.5 --- api/businesses/saveBrandColor.cfm | 6 +++--- portal/menu-builder.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/businesses/saveBrandColor.cfm b/api/businesses/saveBrandColor.cfm index a31c2ae..fe2c257 100644 --- a/api/businesses/saveBrandColor.cfm +++ b/api/businesses/saveBrandColor.cfm @@ -39,9 +39,9 @@ brandColor = structKeyExists(data, "BrandColor") && isSimpleValue(data.BrandColo // Allow empty to clear, or validate hex format if (len(brandColor) GT 0) { - // Must be #RRGGBB format - if (!reFind("^##[0-9A-Fa-f]{6}$", brandColor)) { - apiAbort({ "OK": false, "ERROR": "invalid_color", "MESSAGE": "Color must be in #RRGGBB format" }); + // Must start with # and have 6 hex chars + if (left(brandColor, 1) != chr(35) || len(brandColor) != 7 || !reFind("^[0-9A-Fa-f]{6}$", right(brandColor, 6))) { + apiAbort({ "OK": false, "ERROR": "invalid_color", "MESSAGE": "Color must be in ##RRGGBB format" }); } brandColor = uCase(brandColor); } diff --git a/portal/menu-builder.html b/portal/menu-builder.html index 3e97bc5..b1dc681 100644 --- a/portal/menu-builder.html +++ b/portal/menu-builder.html @@ -2983,7 +2983,7 @@ const data = await response.json(); if (data.OK) { - this.toast('Header uploaded successfully! Recommended size: 1200x400 pixels', 'success'); + this.toast('Header uploaded successfully! Recommended size: 600x200 JPG', 'success'); } else { this.toast(data.MESSAGE || 'Failed to upload header', 'error'); }