Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIN-4810 clear tenant mail address #985

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

rGregnanin
Copy link
Contributor

No description provided.


// Here I am removing strange characters or special symbols
const sanitizedMail = removeExtraSpace
.replace(/[^\w.@-_]/g, "")

Check warning

Code scanning / CodeQL

Overly permissive regular expression range Medium

Suspicious character range that overlaps with \w in the same character class.

Copilot Autofix AI about 17 hours ago

To fix the problem, we need to make the regular expression more precise by explicitly listing the characters we want to include instead of using a range that can match unintended characters. Specifically, we should replace the range @-_ with the exact characters we want to allow: @, ., -, and _.

  • Update the regular expression on line 1899 to explicitly include the characters @, ., -, and _ instead of using the range @-_.
  • This change will ensure that only the intended characters are matched, avoiding the inclusion of unintended characters.
Suggested changeset 1
packages/tenant-process/src/services/tenantService.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/tenant-process/src/services/tenantService.ts b/packages/tenant-process/src/services/tenantService.ts
--- a/packages/tenant-process/src/services/tenantService.ts
+++ b/packages/tenant-process/src/services/tenantService.ts
@@ -1898,3 +1898,3 @@
   const sanitizedMail = removeExtraSpace
-    .replace(/[^\w.@-_]/g, "")
+    .replace(/[^\w.@.\-_]/g, "")
     .replace(/\^/g, "");
EOF
@@ -1898,3 +1898,3 @@
const sanitizedMail = removeExtraSpace
.replace(/[^\w.@-_]/g, "")
.replace(/[^\w.@.\-_]/g, "")
.replace(/\^/g, "");
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants