-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Dev to release #4431
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
Dev to release #4431
Conversation
remove divider comment Enhance room list form with default values and reset functionality change shown stuff to reflect the backend too Refactor CippAddRoomListForm: Remove description field and divider for a cleaner layout Enhance Room Lists Page: Add delete functionality for room lists with confirmation prompt
…st' button with a link to the edit page Change to results as api return progress
…and conditionally format submission data revert more Refactor EditRoomList component to replace CippFormUserSelector with CippFormComponent, enhancing user selection with filtering for existing owners and improved API integration.
…ssociated view component. Update delete action's GroupType to exclude 'Distribution List'.
… and custom data formatting - Added state to store initial values for comparison during form submission. - Implemented a custom data formatter to only send changed values for 'allowExternal' and 'sendCopies'. - Updated form reset logic to include initial values for better state management.
… with view mode toggle
…standards dialog. Integrate CippStandardsDialog to manage dialog state.
…k type and permissions
little cleanup, no broken things this time
Fix: Fix broken filters and enhance UI components
Remove last of grid and unstable grid 2 imports
Feat: Avaliable license count in manage license user action
View options for Standard templates
Feat: Enhance group editing and add hide/show M365 group in outlook
Added Clear Immutable ID to preferences page
Feat: Add functionality for managing room lists
Chore: Update license files to latest version from Microsoft
Feat: Add loading skeleton for contact edit and template pages
Fix: Update .gitignore with AI rules section
const regexPattern = pattern | ||
.replace(/\*/g, '.*') | ||
.replace(/\./g, '\\.'); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 20 days ago
To fix the issue, we need to ensure that any special characters in the pattern
string, especially backslashes (\
), are properly escaped before converting the pattern into a regular expression. This can be done by preprocessing the pattern
string using a function that escapes all regex meta-characters, including backslashes.
The best approach:
- Use a utility function to escape all special regex characters in
pattern
. - Replace
pattern.replace(/\*/g, '.*')
with a safer implementation that uses the utility function. - Maintain the existing functionality (wildcard
*
handling) while ensuring safety.
-
Copy modified lines R58-R60
@@ -55,9 +55,9 @@ | ||
return blacklistedFields.some(pattern => { | ||
if (pattern.includes('*')) { | ||
// Convert wildcard pattern to regex | ||
const regexPattern = pattern | ||
.replace(/\*/g, '.*') | ||
.replace(/\./g, '\\.'); | ||
const escapeRegex = (str) => str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); | ||
const regexPattern = escapeRegex(pattern) | ||
.replace(/\\\*/g, '.*'); // Replace escaped asterisks with .* | ||
const regex = new RegExp(`^${regexPattern}$`, 'i'); | ||
return regex.test(fieldName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't user input.
No description provided.