Skip to content

Commit 2b5f977

Browse files
committed
update cql validation
1 parent 3ef9c5b commit 2b5f977

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/sim/app/api/tools/confluence/search-in-space/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function POST(request: NextRequest) {
5353
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
5454
}
5555

56-
const escapeCqlValue = (value: string) => value.replace(/"/g, '\\"')
56+
const escapeCqlValue = (value: string) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
5757

5858
let cql = `space = "${escapeCqlValue(spaceKey)}"`
5959

apps/sim/app/api/tools/confluence/search/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function POST(request: NextRequest) {
4242
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
4343
}
4444

45-
const escapeCqlValue = (value: string) => value.replace(/"/g, '\\"')
45+
const escapeCqlValue = (value: string) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
4646

4747
const searchParams = new URLSearchParams({
4848
cql: `text ~ "${escapeCqlValue(query)}"`,

0 commit comments

Comments
 (0)