mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-12 14:55:22 +00:00
Low: Fix self-XSS in SVGs
This commit is contained in:
@@ -35,7 +35,7 @@ export const formatMessage = (m) => {
|
||||
return m.message || "";
|
||||
};
|
||||
|
||||
const imageRegex = /\.(png|jpe?g|gif|webp)$/i;
|
||||
export const imageRegex = /\.(png|jpe?g|gif|webp)$/i;
|
||||
export const isImage = (attachment) => {
|
||||
if (!attachment) return false;
|
||||
|
||||
|
||||
@@ -145,8 +145,7 @@ export const hashCode = (s) => {
|
||||
* which is expected by `<html lang>` and `Intl.DateTimeFormat`. Falls back to "en"
|
||||
* if the input is missing or not a string.
|
||||
*/
|
||||
export const getKebabCaseLangStr = (language) =>
|
||||
typeof language === "string" && language.length > 0 ? language.replace(/_/g, "-") : "en";
|
||||
export const getKebabCaseLangStr = (language) => (typeof language === "string" && language.length > 0 ? language.replace(/_/g, "-") : "en");
|
||||
|
||||
export const formatShortDateTime = (timestamp, language) =>
|
||||
new Intl.DateTimeFormat(getKebabCaseLangStr(language), {
|
||||
|
||||
Reference in New Issue
Block a user