From 0e2079a1e5afbe22aad0ffa0d1adb3ae97cd294a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 31 May 2013 14:23:04 -0700 Subject: [PATCH] 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: --- CRM/Activity/Page/AJAX.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; -- 2.25.1