Skip to content

Commit 163c18a

Browse files
Potential fix for pull request finding 'CodeQL / Incomplete string escaping or encoding'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent c2aac33 commit 163c18a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/fiori-freestyle-writer/src/defaults.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ export function setDefaults(ffApp: FreestyleApp<unknown>): void {
9090

9191
// Specific escaping is required for FLP texts in flpSandbox.html template file
9292
// Escapes '\' with '\\\\' and '"' with '\"' to correctly render inputs in a secure way
93-
export const escapeFLPText = (s: string): string => s.replaceAll('\\', '\\\\').replace(/(")/g, '\\$&');
93+
export const escapeFLPText = (s: string): string =>
94+
s.replace(/\\/g, '\\\\').replace(/"/g, '\\"');

0 commit comments

Comments
 (0)