fix(uve): Fixed sanitize issue on url queryParam #31121
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request focuses on refactoring the URL sanitization process across multiple files in the
core-web/libs/portlets/edit-ema/portlet/src/lib
directory. The main changes involve removing thesanitizeURL
function where it is no longer necessary and updating the logic to handle URLs more efficiently.URL Sanitization Refactoring:
core-web/libs/portlets/edit-ema/portlet/src/lib/services/guards/edit-ema.guard.ts
: Updated theconfirmQueryParams
function to handle URL parameter special cases directly within the function, removing redundant checks.core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/toolbar/withEditorToolbar.ts
: Removed thesanitizeURL
import and its usage in thewithEditorToolbar
function. [1] [2]core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/toolbar/withUVEToolbar.ts
: Removed thesanitizeURL
import and its usage in thewithUVEToolbar
function. [1] [2] [3]core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts
: Removed thesanitizeURL
function from thebuildIframeURL
function and updated thewithEditor
function to sanitize the URL only when necessary. [1] [2]Utility Function and Tests Update:
core-web/libs/portlets/edit-ema/portlet/src/lib/utils/index.ts
: Updated thesanitizeURL
function to handle edge cases more effectively, including retaining 'index' if it is not part of a nested path.core-web/libs/portlets/edit-ema/portlet/src/lib/utils/utils.spec.ts
: Revised the test cases forsanitizeURL
to cover the updated behavior and ensure all edge cases are tested.This PR fixes: #31095