Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(analytics): keep spaces in filter values (#14522)
Kanika Bansaleffe2dfb8823
diff --git a/crates/analytics/src/query.rs b/crates/analytics/src/query.rsindex c0646ab7b6..f1da80b6e6 100644--- a/crates/analytics/src/query.rs+++ b/crates/analytics/src/query.rs@@ -552,13 +552,10 @@ pub enum FilterTypes {IsNotNull,}-/// Strips whitespace and escapes SQL string metacharacters so the value is-/// safe inside a single-quoted SQL literal: `'<sanitized>'`.+/// Escapes `\` and `'` so the value stays inside a single-quoted SQL literal.+/// Spaces are kept so values match as stored.pub fn sanitize_sql_string_literal(raw: &str) -> String {- let sanitized = raw- .replace(' ', "")- .replace('\\', "\\\\")- .replace('\'', "''");+ let sanitized = raw.replace('\\', "\\\\").replace('\'', "''");format!("'{sanitized}'")}