@autobusal/routes-order 1.41.0 → 1.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,24 @@ import { SubTitle } from '../../styles';
11
11
  import { Container, NoticeEmail } from './styles';
12
12
  import { BillingData } from '@autobusal/providers/types/persons';
13
13
 
14
+ /*
15
+ * Claude - 2026-11-06 (audit 2026-10-28, low): "I agree to the {{terms}}" as
16
+ * text with the link as an element. It used to be rendered as HTML - stored
17
+ * XSS the day an admin can edit translations.
18
+ */
19
+ const SLOT = '\u0001';
20
+
21
+ const Terms = ({ text, name }: { text: string, name: string }): JSX.Element => {
22
+ const [before, ...rest] = text.split(SLOT);
23
+
24
+ return (
25
+ <span>
26
+ { before }
27
+ { rest.length > 0 && <><a href="/page/terms" target="_blank" rel="noopener">{ name }</a>{ rest.join('') }</> }
28
+ </span>
29
+ );
30
+ };
31
+
14
32
  interface Props {
15
33
  t: TFunction<'common'>
16
34
  errors: FieldErrors
@@ -233,11 +251,7 @@ const Billing = ({ errors, t, refs, only }: Props): JSX.Element => {
233
251
  <label className="single">
234
252
  <input type="checkbox" value="1" aria-required="true" { ...refs('terms', Validate('required', t)) } />&nbsp;
235
253
 
236
- <span dangerouslySetInnerHTML={{
237
- __html: t('routes_order.step5.billing.terms', {
238
- terms: `<a href="/page/terms" target="_blank">${ t('routes_order.step5.billing.terms_name') }</a>`
239
- })
240
- }} />
254
+ <Terms text={ t('routes_order.step5.billing.terms', { terms: SLOT, interpolation: { escapeValue: false } }) } name={ t('routes_order.step5.billing.terms_name') } />
241
255
  </label>
242
256
 
243
257
  { Display(errors.terms) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.41.0",
3
+ "version": "1.41.1",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts",