Skip to content

Commit

Permalink
fix: Incomplete multi-character sanitation (#2228)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Sep 20, 2023
1 parent 03e24e2 commit a37f659
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions editor.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"rxjs": "^7.8.1",
"scroll-into-view-if-needed": "^2.2.31",
"sharedb": "^3.3.1",
"striptags": "^3.2.0",
"swr": "^2.2.0",
"tippy.js": "^6.3.7",
"uuid": "^9.0.0",
Expand Down
7 changes: 7 additions & 0 deletions editor.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion editor.planx.uk/src/@planx/components/Send/bops/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
ResponseMetaData,
USER_ROLES,
} from "../model";
import striptags from "striptags";

export const bopsDictionary = {
// applicant or agent details provided via TextInput(s) or ContactInput component
Expand Down Expand Up @@ -231,7 +232,7 @@ export const makePayload = (
if (flow[id]?.data?.policyRef) {
metadata.policy_refs = [
// remove html tags
{ text: flow[id].data.policyRef.replace(/<[^>]*>/g, "").trim() },
{ text: striptags(flow[id].data.policyRef) },
];
}
metadata = addPortalName(id, flow, metadata);
Expand Down

0 comments on commit a37f659

Please sign in to comment.