summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/utils/validation-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/utils/validation-utils.ts')
-rw-r--r--catalog-ui/src/app/utils/validation-utils.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/catalog-ui/src/app/utils/validation-utils.ts b/catalog-ui/src/app/utils/validation-utils.ts
index b7e43f79ba..bcb49d8b89 100644
--- a/catalog-ui/src/app/utils/validation-utils.ts
+++ b/catalog-ui/src/app/utils/validation-utils.ts
@@ -64,7 +64,10 @@ export class ValidationUtils {
if (!text) {
return null;
}
- return text.replace(/\s+/g, ' ').replace(/%[A-Fa-f0-9]{2}/g, '').trim();
+ return text.replace(/\s+/g, ' ').replace(/%[A-Fa-f0-9]{2}/g, '')
+ .replace(/&/g, "&").replace(/>/g, ">")
+ .replace(/</g, "&lt;").replace(/"/g, "&quot;")
+ .replace(/'/g, "&apos;").trim();
}
public getValidationPattern = (validationType:string, parameterType?:string):RegExp => {