From f533b210d762cf1a1ec419209a41c151863f9bf7 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Fri, 27 May 2016 16:24:50 +1200 Subject: [PATCH] CRM-18684 fix fatal error by backporting 4.7 hack --- CRM/Contact/BAO/Query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 9ab5622e9f..4bf2395ece 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -5807,6 +5807,10 @@ AND displayRelType.is_active = 1 else { $orderBy = trim($sort->orderBy()); } + // Deliberately remove the backticks again, as they mess up the evil + // string munging below. This balanced by re-escaping before use. + $orderBy = str_replace('`', '', $orderBy); + if (!empty($orderBy)) { // this is special case while searching for // change log CRM-1718 -- 2.25.1