Initial upload to Gitea
This commit is contained in:
1 parent
78193254ad
commit
8478998cae
1485 files changed
+461025
-42348
No files matched your search
+9
-3
@@ -9,9 +9,15 @@ function makeCssBackground(type, value) {
|
||||
}
|
||||
|
||||
if (type === "url" || type === "upload" || type === "image") {
|
||||
if (/^https?:\/\//i.test(v)) return `url("${v.replace(/["\\\n\r\f()<>]/g, encodeURIComponent)}")`;
|
||||
if (/^data:image\/(png|jpe?g|webp|gif);base64,[A-Za-z0-9+/=]+$/i.test(v)) return `url("${v}")`;
|
||||
if (/^\/[a-z0-9/_\-.]+$/i.test(v) && !v.includes('..')) return `url("${v}?v=${Date.now()}")`;
|
||||
if (/^https?:\/\//i.test(v)) {
|
||||
if (v.length > 2048) return null;
|
||||
return `url("${v.replace(/["\\\n\r\f()<>]/g, encodeURIComponent)}")`;
|
||||
}
|
||||
if (/^data:image\/(png|jpe?g|webp|gif);base64,[A-Za-z0-9+/=]+$/i.test(v)) {
|
||||
if (v.length > 24_000_000) return null;
|
||||
return `url("${v}")`;
|
||||
}
|
||||
if (/^\/[a-z0-9/_\-.]+$/i.test(v) && !v.includes("..") && v.length <= 512) return `url("${v}?v=${Date.now()}")`;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user