mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-09 15:38:27 +01:00
Fix infinite loop in splitEmail() when name is '"'
This commit is contained in:
parent
22a0ae2563
commit
6679338888
@ -103,7 +103,7 @@ export function splitEmail(email_string) : { name : string, email : string }
|
|||||||
split.email = parts[1].substring(0, parts[1].length - 1).trim();
|
split.email = parts[1].substring(0, parts[1].length - 1).trim();
|
||||||
split.name = parts[0].trim();
|
split.name = parts[0].trim();
|
||||||
// remove quotes
|
// remove quotes
|
||||||
while((split.name[0] === '"' || split.name[0] === "'") && split.name[0] === split.name.substr(-1))
|
while(split.name.length > 1 && (split.name[0] === '"' || split.name[0] === "'") && split.name[0] === split.name.substring(split.name.length - 1))
|
||||||
{
|
{
|
||||||
split.name = split.name.substring(1, split.name.length - 1);
|
split.name = split.name.substring(1, split.name.length - 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user