Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Only replace starting and ending * char.

Mike Cao99f92f2c873b
diff --git a/src/queries/analytics/reports/getFunnel.ts b/src/queries/analytics/reports/getFunnel.ts
index 43b552048..3a81157fd 100644
--- a/src/queries/analytics/reports/getFunnel.ts
+++ b/src/queries/analytics/reports/getFunnel.ts
@@ -76,9 +76,9 @@ async function relationalQuery(
let operator = '=';
let paramValue = cv.value;
- if (cv.value.includes('*')) {
+ if (cv.value.startsWith('*') || cv.value.endsWith('*')) {
operator = 'like';
- paramValue = cv.value.replaceAll('*', '%');
+ paramValue = cv.value.replace(/^\*|\*$/g, '%');
}
if (levelNumber === 1) {
@@ -180,9 +180,9 @@ async function clickhouseQuery(
let operator = '=';
let paramValue = cv.value;
- if (cv.value.includes('*')) {
+ if (cv.value.startsWith('*') || cv.value.endsWith('*')) {
operator = 'like';
- paramValue = cv.value.replaceAll('*', '%');
+ paramValue = cv.value.replace(/^\*|\*$/g, '%');
}
if (levelNumber === 1) {