From 124be6eb342db2a1bd568451e082ed6bca878d21 Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Wed, 7 Jan 2026 16:44:13 +0400 Subject: [PATCH 1/2] Demos: fix regular expression injection --- apps/demos/utils/visual-tests/matrix-test-helper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/demos/utils/visual-tests/matrix-test-helper.ts b/apps/demos/utils/visual-tests/matrix-test-helper.ts index ff25b91e86de..809cc41c01e9 100644 --- a/apps/demos/utils/visual-tests/matrix-test-helper.ts +++ b/apps/demos/utils/visual-tests/matrix-test-helper.ts @@ -47,7 +47,8 @@ function shouldRunTestExplicitlyInternal(framework, product, demo) { } function patternGroupFromValues(product, demo, framework) { - const wrap = (x) => RegExp(x || '.*', 'i'); + const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const wrap = (x) => RegExp(x ? escapeRegExp(x) : '.*', 'i'); return { product: wrap(product), demo: wrap(demo), From 5da27d04f1d3af5deb0e7fcfbd949ec7f834c265 Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Thu, 8 Jan 2026 12:44:00 +0400 Subject: [PATCH 2/2] Update apps/demos/utils/visual-tests/matrix-test-helper.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: EugeniyKiyashko --- apps/demos/utils/visual-tests/matrix-test-helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/demos/utils/visual-tests/matrix-test-helper.ts b/apps/demos/utils/visual-tests/matrix-test-helper.ts index 809cc41c01e9..5fdc92a4d7a5 100644 --- a/apps/demos/utils/visual-tests/matrix-test-helper.ts +++ b/apps/demos/utils/visual-tests/matrix-test-helper.ts @@ -47,7 +47,7 @@ function shouldRunTestExplicitlyInternal(framework, product, demo) { } function patternGroupFromValues(product, demo, framework) { - const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\-]/g, '\\$&'); const wrap = (x) => RegExp(x ? escapeRegExp(x) : '.*', 'i'); return { product: wrap(product),