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 <noreply@anthropic.com>
This commit is contained in:
parent
0038c481ab
commit
85f64c2add
2 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue