Skip to content

Node.js based forum software built for the modern web

fix: favicon path

Barış Soner Uşaklıe2dc592c4f21
diff --git a/src/webserver.js b/src/webserver.js
index ab8dc5bc0d..18f57faa40 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -227,6 +227,9 @@ function setupHelmet(app) {
function setupFavicon(app) {
let faviconPath = meta.config['brand:favicon'] || 'favicon.ico';
faviconPath = path.join(nconf.get('base_dir'), 'public', faviconPath.replace(/assets\/uploads/, 'uploads'));
+ if (!faviconPath.startsWith(nconf.get('upload_path'))) {
+ faviconPath = path.join(nconf.get('base_dir'), 'public', 'favicon.ico');
+ }
if (file.existsSync(faviconPath)) {
app.use(nconf.get('relative_path'), favicon(faviconPath));
}