From 9caac49ef7e58dafe657bf1377c6df79269eef14 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 9 Feb 2015 12:10:40 -0800 Subject: [PATCH] DynamicFKAuthorization - Sanitize with convertStringToCamel() instead of strtolower() --- Civi/API/Subscriber/DynamicFKAuthorization.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Civi/API/Subscriber/DynamicFKAuthorization.php b/Civi/API/Subscriber/DynamicFKAuthorization.php index 922d2d806d..7e674c8b17 100644 --- a/Civi/API/Subscriber/DynamicFKAuthorization.php +++ b/Civi/API/Subscriber/DynamicFKAuthorization.php @@ -127,7 +127,7 @@ class DynamicFKAuthorization implements EventSubscriberInterface { */ public function __construct($kernel, $entityName, $actions, $lookupDelegateSql, $lookupCustomFieldSql, $allowedDelegates = NULL) { $this->kernel = $kernel; - $this->entityName = $entityName; + $this->entityName = \CRM_Utils_String::convertStringToCamel($entityName); $this->actions = $actions; $this->lookupDelegateSql = $lookupDelegateSql; $this->lookupCustomFieldSql = $lookupCustomFieldSql; @@ -142,7 +142,7 @@ class DynamicFKAuthorization implements EventSubscriberInterface { */ public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) { $apiRequest = $event->getApiRequest(); - if ($apiRequest['version'] == 3 && strtolower($apiRequest['entity']) == strtolower($this->entityName) && in_array(strtolower($apiRequest['action']), $this->actions)) { + if ($apiRequest['version'] == 3 && \CRM_Utils_String::convertStringToCamel($apiRequest['entity']) == $this->entityName && in_array(strtolower($apiRequest['action']), $this->actions)) { if (isset($apiRequest['params']['field_name'])) { $fldIdx = \CRM_Utils_Array::index(array('field_name'), $this->getCustomFields()); if (empty($fldIdx[$apiRequest['params']['field_name']])) { -- 2.25.1