forked from butlerx/wetty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
escape special chars in username:
- . \ @
(butlerx#406)
- Loading branch information
1 parent
8722a71
commit 1e4f173
Showing
2 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const escapeShell = (username: string): string => | ||
username.replace(/^-|[^a-zA-Z0-9_-]/g, ''); | ||
// eslint-disable-next-line no-useless-escape | ||
username.replace(/^-|[^a-zA-Z0-9_\\\-\.\@-]/g, ''); |