|
@@ -100,17 +100,6 @@ export function nl2br(str: string): string {
|
|
|
return str.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * This function has a critical security impact, make sure to check all usages before changing this function.
|
|
|
- * In some parts of our code we rely on that this only really is a string starting with http(s).
|
|
|
- */
|
|
|
-export function isUrl(str: any): boolean {
|
|
|
- return (
|
|
|
- typeof str === 'string' &&
|
|
|
- (str.indexOf('http://') === 0 || str.indexOf('https://') === 0)
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
export function escape(str: string): string {
|
|
|
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
|
}
|