Skip to content

Commit 4e21a08

Browse files
committed
refactor(security): use createReferencePattern() instead of inline regex
1 parent dc41251 commit 4e21a08

File tree

1 file changed

+2
-4
lines changed
  • apps/sim/app/api/function/execute

1 file changed

+2
-4
lines changed

apps/sim/app/api/function/execute/route.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { type OutputSchema, resolveBlockReference } from '@/executor/utils/block
1818
import { formatLiteralForCode } from '@/executor/utils/code-formatting'
1919
import {
2020
createEnvVarPattern,
21+
createReferencePattern,
2122
createWorkflowVariablePattern,
2223
} from '@/executor/utils/reference-validation'
2324
export const dynamic = 'force-dynamic'
@@ -27,10 +28,7 @@ export const MAX_DURATION = 210
2728

2829
const logger = createLogger('FunctionExecuteAPI')
2930

30-
const TAG_PATTERN = new RegExp(
31-
`${REFERENCE.START}([^${REFERENCE.START}${REFERENCE.END}]+)${REFERENCE.END}`,
32-
'g'
33-
)
31+
const TAG_PATTERN = createReferencePattern()
3432

3533
const E2B_JS_WRAPPER_LINES = 3
3634
const E2B_PYTHON_WRAPPER_LINES = 1

0 commit comments

Comments
 (0)