fix(logo): keep absolute nerkh avatar URLs intact

Stop rewriting legacy upload hosts to SuperAdmin; only prefix relative /uploads/ paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-07 20:10:11 +03:30
co-authored by Cursor
parent 7ab391d48f
commit 47beece729
2 changed files with 8 additions and 37 deletions
+4 -16
View File
@@ -220,22 +220,11 @@
var BOOT_LOGO_KEY = 'BOOT_LOGO_URL'
var BOOT_LOGO_VERSION_KEY = 'BOOT_LOGO_VERSION'
var LEGACY_LOGO_HOSTS = {
'nerkh.gold': 1,
'www.nerkh.gold': 1,
'tablo.talasevin.ir': 1,
'ah.aygingold.ir': 1,
'abshode-service.montgit.ir': 1
}
function rewriteLegacyBootLogoUrl(url) {
var value = String(url || '').trim()
if (!value || !/^https?:\/\//i.test(value)) return value
try {
var parsed = new URL(value)
var host = String(parsed.hostname || '').toLowerCase()
if (!LEGACY_LOGO_HOSTS[host]) return value
if (!/\/uploads\//i.test(parsed.pathname || '')) return value
if (!value) return ''
if (value.indexOf('/uploads/') === 0) {
var base = 'https://adm.montzar.ir'
try {
var last = localStorage.getItem('CONFIG_Success_URL')
@@ -245,10 +234,9 @@
base = path && path !== '/' ? sa.origin + path : sa.origin
}
} catch (e) {}
return base + parsed.pathname
} catch (e) {
return value
return base + value
}
return value
}
function pickAvatarRaw(value) {