Commit 616d437
authored
feat: improve username sanitization in profiling example (#7868)
Hello,
This commit updates the username sanitization logic in the profiling
example code to allow only alphanumeric characters. The original
pattern (/[!@#$%^&*]/g) was limited and could lead to inconsistent
behavior depending on input.
Changed:
- From: username = username.replace(/[!@#$%^&*]/g, '')
- To: username = username.replace(/[^a-zA-Z0-9]/g, '')
This change makes the input handling cleaner and more appropriate
for educational purposes, aligning better with common sanitization
practices.
Relates to: #7867
Signed-off-by: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com>1 parent 3e5b666 commit 616d437
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
0 commit comments