mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-24 11:51:43 +02:00
Fix infinite loop in splitEmail() when name is '"'
This commit is contained in:
parent
b2150be8f7
commit
749ebcd9d1
@ -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…
x
Reference in New Issue
Block a user