mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-04 04:22:58 +00:00
fef
This commit is contained in:
+4
-3
@@ -126,9 +126,10 @@
|
||||
`;
|
||||
|
||||
const img = document.createElement('img');
|
||||
// Fix image path - remove any leading slashes and add the correct base path
|
||||
const cleanImagePath = bannerImage.replace(/^\/+/, '');
|
||||
img.src = bannerImage.startsWith('http') ? bannerImage : `/uploads/${cleanImagePath}`;
|
||||
// Handle image path - use as is if it's an absolute path or URL
|
||||
img.src = bannerImage.startsWith('http') || bannerImage.startsWith('/')
|
||||
? bannerImage
|
||||
: `/uploads/${bannerImage.replace(/^\/+/, '')}`;
|
||||
img.alt = 'Banner image';
|
||||
img.style.cssText = `
|
||||
max-width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user