mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Bugfix: Email addressparser
Cleanup vendor scripts
This commit is contained in:
parent
aaf4933b0a
commit
a8ef5ec75b
11 changed files with 651 additions and 968 deletions
|
|
@ -7,19 +7,15 @@ import { Mime } from 'Common/Mime';
|
|||
const
|
||||
$ = jQuery,
|
||||
$div = $('<div></div>'),
|
||||
isArray = Array.isArray;
|
||||
|
||||
var htmlspecialchars = ((de,se,gt,lt,sq,dq,bt) => {
|
||||
return (str, quote_style = 3, double_encode = true) => {
|
||||
str = (''+str)
|
||||
.replace(double_encode?de:se,'&')
|
||||
.replace(gt,'<')
|
||||
.replace(lt,'>')
|
||||
.replace(bt,'`');
|
||||
if (quote_style & 1) { str = str.replace(sq,'''); }
|
||||
return (quote_style & 2) ? str.replace(dq,'"') : str;
|
||||
};
|
||||
})(/&/g,/&(?![\w#]+;)/gi,/</g,/>/g,/'/g,/"/g,/`/g);
|
||||
isArray = Array.isArray,
|
||||
htmlmap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
},
|
||||
htmlspecialchars = str => (''+str).replace(/[&<>"']/g, m => htmlmap[m]);
|
||||
|
||||
/**
|
||||
* @param {*} value
|
||||
|
|
@ -89,15 +85,13 @@ export function simpleQueryParser(queryString) {
|
|||
* @returns {string}
|
||||
*/
|
||||
export function fakeMd5(len = 32) {
|
||||
const line = '0123456789abcdefghijklmnopqrstuvwxyz',
|
||||
lineLen = line.length;
|
||||
const line = '0123456789abcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
len = pInt(len);
|
||||
|
||||
let result = '';
|
||||
while (result.length < len) {
|
||||
result += line.substr(Math.round(Math.random() * lineLen), 1);
|
||||
}
|
||||
while (len--)
|
||||
result += line.substr(Math.round(Math.random() * 36), 1);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue