Skip to content

Commit

Permalink
Merge pull request #9668 from idressos/virtuser_file-email2user-fix
Browse files Browse the repository at this point in the history
Fix virtuser_file plugin email2user() function not accounting for backward slashes in username
  • Loading branch information
pabzm authored Nov 5, 2024
2 parents 749eb38 + 4c80b86 commit 875e370
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/virtuser_file/virtuser_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public function email2user($p)
$arr = preg_split('/\s+/', trim($r[$i]));

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

0 comments on commit 875e370

Please sign in to comment.