From: Coleman Watts Date: Fri, 31 May 2013 21:23:04 +0000 (-0700) Subject: One last eval CRM-12743 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0e2079a1e5afbe22aad0ffa0d1adb3ae97cd294a;p=civicrm-core.git One last eval CRM-12743 ---------------------------------------- * CRM-12743: Eliminate use of eval in core code http://issues.civicrm.org/jira/browse/CRM-12743 ---------------------------------------- * CRM-12743: http://issues.civicrm.org/jira/browse/CRM-12743 * CRM-12743:: http://issues.civicrm.org/jira/browse/CRM-12743: --- diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index c2e1bc75bd..6b3b15f706 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -142,9 +142,8 @@ class CRM_Activity_Page_AJAX { foreach ($clientRelationships as $key => $row) { $sortArray[$key] = $row[$sort]; } - $sort_type = "SORT_".strtoupper($sortOrder); - $sort_function = "array_multisort(\$sortArray, ".$sort_type.", \$clientRelationships);"; - eval($sort_function); + $sort_type = "SORT_" . strtoupper($sortOrder); + array_multisort($sortArray, constant($sort_type), $clientRelationships); //limit the rows $allClientRelationships = $clientRelationships; @@ -239,10 +238,8 @@ class CRM_Activity_Page_AJAX { $sortArray[$key] = $row[$sort]; } - $sort_type = "SORT_".strtoupper($sortOrder); - - $sort_function = "array_multisort(\$sortArray, ".$sort_type.", \$caseRelationships);"; - eval($sort_function); + $sort_type = "SORT_" . strtoupper($sortOrder); + array_multisort($sortArray, constant($sort_type), $caseRelationships); //limit rows display $allCaseRelationships = $caseRelationships;