Skip to content

EspoCRM – Open Source CRM Application

sanitize navbar color

Yuri Kuznetsovcbcc560bd3da
diff --git a/client/src/views/site/navbar.js b/client/src/views/site/navbar.js
index e8b533f34c..50ae825bd4 100644
--- a/client/src/views/site/navbar.js
+++ b/client/src/views/site/navbar.js
@@ -1286,6 +1286,13 @@ class NavbarSiteView extends View {
color = this.getMetadata().get(['clientDefs', tab, 'color']);
}
+ if (
+ color &&
+ !/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(color)
+ ) {
+ color = null;
+ }
+
if (!params.tabIconsDisabled && !isGroup && !isDivider && !isUrl) {
iconClass = this.getMetadata().get(['clientDefs', tab, 'iconClass'])
}