Skip to content

Commit 875e370

Browse files
authored
Merge pull request #9668 from idressos/virtuser_file-email2user-fix
Fix virtuser_file plugin email2user() function not accounting for backward slashes in username
2 parents 749eb38 + 4c80b86 commit 875e370

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/virtuser_file/virtuser_file.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public function email2user($p)
6868
$arr = preg_split('/\s+/', trim($r[$i]));
6969

7070
if (count($arr) > 0) {
71-
$p['user'] = trim($arr[count($arr) - 1]);
71+
// Replace '\@' with '@' to handle cases where internal usernames include an '@' character.
72+
// Sometimes usernames with '@' are saved with a leading '\' to avoid conflicts.
73+
$p['user'] = trim(str_replace('\@', '@', $arr[count($arr) - 1]));
7274
break;
7375
}
7476
}

0 commit comments

Comments
 (0)