@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.
- package/Step5/Billing/Billing.tsx +19 -5
- package/package.json +1 -1
|
@@ -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)) } />
|
|
235
253
|
|
|
236
|
-
<
|
|
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) }
|