From f5f2b1cebe43df6812db4a8cbc1b2ea5acc1130f Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Wed, 27 Apr 2016 14:26:50 +0200 Subject: [PATCH] Removed unnecessary parts of the Mysql regexes. --- CRM/Utils/Rule.php | 4 ++-- CRM/Utils/Type.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 73b978967b..eeb97a2914 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -120,7 +120,7 @@ class CRM_Utils_Rule { // // MySQL permits column names that don't match this (eg containing spaces), // but CiviCRM won't create those ... - if (!preg_match('/^[\w_]+(\.[\w_]+)?$/i', $str)) { + if (!preg_match('/^[\w]+(\.[\w]+)?$/i', $str)) { return FALSE; } @@ -154,7 +154,7 @@ class CRM_Utils_Rule { // at all, so we split and loop over. $parts = explode(',', $str); foreach ($parts as $part) { - if (!preg_match('/^(([\w_]+)((\.)([\w_]+))?( (asc|desc))?)$/i', trim($part))) { + if (!preg_match('/^(([\w]+)((\.)([\w]+))?( (asc|desc))?)$/i', trim($part))) { return FALSE; } } diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index 7f9ddafddb..8bbdb8cb61 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -296,7 +296,7 @@ class CRM_Utils_Type { if (CRM_Utils_Rule::mysqlOrderBy($data)) { $parts = explode(',', $data); foreach ($parts as &$part) { - $part = preg_replace_callback('/(?:([\w_]+)(?:(?:\.)([\w_]+))?(?: (asc|desc))?)/i', array('CRM_Utils_Type', 'mysqlOrderByCallback'), trim($part)); + $part = preg_replace_callback('/(?:([\w]+)(?:(?:\.)([\w]+))?(?: (asc|desc))?)/i', array('CRM_Utils_Type', 'mysqlOrderByCallback'), trim($part)); } return implode(', ', $parts); } -- 2.25.1