Commits

Tim Donohue authored and github-actions[bot] committed bb84d86cf52
Fix code scanning alert no. 6: Incomplete string escaping or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> (cherry picked from commit 372444c50ac28a6c7f68b20695bea616a3ab8b7f)
No tags

src/app/core/shared/metadata.utils.ts

Modified
156 156 * Gets the list of keys in the map limited by, and in the order given by `keyOrKeys`.
157 157 *
158 158 * @param {MetadataMapInterface} mdMap The source map.
159 159 * @param {string|string[]} keyOrKeys The metadata key(s) in scope. Wildcards are supported; see above.
160 160 */
161 161 private static resolveKeys(mdMap: MetadataMapInterface = {}, keyOrKeys: string | string[]): string[] {
162 162 const inputKeys: string[] = keyOrKeys instanceof Array ? keyOrKeys : [keyOrKeys];
163 163 const outputKeys: string[] = [];
164 164 for (const inputKey of inputKeys) {
165 165 if (inputKey.includes('*')) {
166 - const inputKeyRegex = new RegExp('^' + inputKey.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
166 + const inputKeyRegex = new RegExp('^' + inputKey.replace(/\\/g, '\\\\').replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
167 167 for (const mapKey of Object.keys(mdMap)) {
168 168 if (!outputKeys.includes(mapKey) && inputKeyRegex.test(mapKey)) {
169 169 outputKeys.push(mapKey);
170 170 }
171 171 }
172 172 } else if (mdMap.hasOwnProperty(inputKey) && !outputKeys.includes(inputKey)) {
173 173 outputKeys.push(inputKey);
174 174 }
175 175 }
176 176 return outputKeys;

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut