Skip to content

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

Merged
merged 139 commits into from
Jul 14, 2025
Merged

Dev to release #4431

merged 139 commits into from
Jul 14, 2025

Conversation

KelvinTegelaar
Copy link
Owner

No description provided.

kris6673 and others added 30 commits June 23, 2025 23:29
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.
…standards dialog. Integrate CippStandardsDialog to manage dialog state.
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
Comment on lines +58 to +60
const regexPattern = pattern
.replace(/\*/g, '.*')
.replace(/\./g, '\\.');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

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:

  1. Use a utility function to escape all special regex characters in pattern.
  2. Replace pattern.replace(/\*/g, '.*') with a safer implementation that uses the utility function.
  3. Maintain the existing functionality (wildcard * handling) while ensuring safety.

Suggested changeset 1
src/components/CippComponents/CippTemplateEditor.jsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/components/CippComponents/CippTemplateEditor.jsx b/src/components/CippComponents/CippTemplateEditor.jsx
--- a/src/components/CippComponents/CippTemplateEditor.jsx
+++ b/src/components/CippComponents/CippTemplateEditor.jsx
@@ -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);
       }
EOF
@@ -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);
}
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link
Owner Author

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.

@KelvinTegelaar KelvinTegelaar merged commit a674097 into main Jul 14, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants