From: Tim Otten Date: Mon, 9 Feb 2015 20:10:40 +0000 (-0800) Subject: DynamicFKAuthorization - Sanitize with convertStringToCamel() instead of strtolower() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9caac49ef7e58dafe657bf1377c6df79269eef14;p=civicrm-core.git DynamicFKAuthorization - Sanitize with convertStringToCamel() instead of strtolower() --- 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']])) {