From: Mattias Michaux Date: Wed, 27 Apr 2016 12:26:50 +0000 (+0200) Subject: Removed unnecessary parts of the Mysql regexes. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f5f2b1cebe43df6812db4a8cbc1b2ea5acc1130f;p=civicrm-core.git Removed unnecessary parts of the Mysql regexes. --- 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); }