Merge pull request #5 from PR0M3TH3AN/codex/fix-bugs-in-the-codebase

Require absolute HTTP(S) image URLs in normalizeImageUrl
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-05-16 12:37:22 -04:00
commit a9c9fe2e2f
1 file changed
+4 -1
+4 -1
View File
@@ -2592,7 +2592,10 @@
function normalizeImageUrl(raw) {
const value = String(raw || '').trim();
if (!value) throw new Error('Enter an image URL.');
const parsed = new URL(value, window.location.href);
if (!/^https?:\/\//i.test(value)) {
throw new Error('Use a full http or https image URL.');
}
const parsed = new URL(value);
if (!['http:', 'https:'].includes(parsed.protocol)) {
throw new Error('Use an http or https image URL.');
}