Issue #93 Update CRM_Utils_Rule::mysqlOrderBy() to accommodate more than 2 joins
authorChamil Wijesooriya <Chamil@MTLGROUP.LOCAL>
Wed, 11 Jul 2018 12:03:15 +0000 (13:03 +0100)
committerChamil Wijesooriya <Chamil@MTLGROUP.LOCAL>
Wed, 11 Jul 2018 12:03:15 +0000 (13:03 +0100)
CRM/Utils/Rule.php

index 61a467451fd26e106c6fd8d59e6b5b001f0b2320..9f3345930c968feaba4afb157b4a160f33086cd0 100644 (file)
@@ -157,7 +157,7 @@ class CRM_Utils_Rule {
     // at all, so we split and loop over.
     $parts = explode(',', $str);
     foreach ($parts as $part) {
-      if (!preg_match('/^((`[\w-]{1,64}`|[\w-]{1,64})\.)?(`[\w-]{1,64}`|[\w-]{1,64})( (asc|desc))?$/i', trim($part))) {
+      if (!preg_match('/^((`[\w-]{1,64}`|[\w-]{1,64})\.)+?(`[\w-]{1,64}`|[\w-]{1,64})( (asc|desc))?$/i', trim($part))) {
         return FALSE;
       }
     }