acsi-core 0.9.13 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/sanitizeSrc.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -3295,18 +3295,18 @@ var utcToLocalTime = (function (time, FORMAT) {
|
|
|
3295
3295
|
|
|
3296
3296
|
var sanitizeSrc = function sanitizeSrc(url) {
|
|
3297
3297
|
if (!url || typeof url !== 'string') {
|
|
3298
|
-
return
|
|
3298
|
+
return '';
|
|
3299
3299
|
}
|
|
3300
3300
|
url = url.trim().replace(/[\s\n\r\t]+/g, '');
|
|
3301
3301
|
if (url.length > 2048) {
|
|
3302
|
-
return
|
|
3302
|
+
return '';
|
|
3303
3303
|
}
|
|
3304
3304
|
var dangerousProtocols = ['javascript:', 'data:text/html', 'vbscript:', 'file:', 'about:', 'blob:'];
|
|
3305
3305
|
var lowerUrl = url.toLowerCase();
|
|
3306
3306
|
for (var _i = 0, _dangerousProtocols = dangerousProtocols; _i < _dangerousProtocols.length; _i++) {
|
|
3307
3307
|
var protocol = _dangerousProtocols[_i];
|
|
3308
3308
|
if (lowerUrl.startsWith(protocol)) {
|
|
3309
|
-
return
|
|
3309
|
+
return '';
|
|
3310
3310
|
}
|
|
3311
3311
|
}
|
|
3312
3312
|
var decoded = decodeURIComponent(url);
|
|
@@ -3314,7 +3314,7 @@ var sanitizeSrc = function sanitizeSrc(url) {
|
|
|
3314
3314
|
for (var _i2 = 0, _dangerousProtocols2 = dangerousProtocols; _i2 < _dangerousProtocols2.length; _i2++) {
|
|
3315
3315
|
var _protocol = _dangerousProtocols2[_i2];
|
|
3316
3316
|
if (decodedLower.includes(_protocol)) {
|
|
3317
|
-
return
|
|
3317
|
+
return '';
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
3320
3320
|
try {
|
|
@@ -3322,18 +3322,18 @@ var sanitizeSrc = function sanitizeSrc(url) {
|
|
|
3322
3322
|
if (/^data:image\/(png|jpeg|jpg|gif|webp|bmp|ico);base64,[A-Za-z0-9+/]+=*$/.test(url)) {
|
|
3323
3323
|
return url;
|
|
3324
3324
|
}
|
|
3325
|
-
return
|
|
3325
|
+
return '';
|
|
3326
3326
|
}
|
|
3327
3327
|
var parsed = new URL(url, window.location.origin);
|
|
3328
3328
|
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
3329
|
-
return
|
|
3329
|
+
return '';
|
|
3330
3330
|
}
|
|
3331
3331
|
if (parsed.username || parsed.password) {
|
|
3332
|
-
return
|
|
3332
|
+
return '';
|
|
3333
3333
|
}
|
|
3334
3334
|
return parsed.href;
|
|
3335
3335
|
} catch (error) {
|
|
3336
|
-
return
|
|
3336
|
+
return '';
|
|
3337
3337
|
}
|
|
3338
3338
|
};
|
|
3339
3339
|
|