DynamicFKAuthorization - Security checks should not be case-sensitive.
authorTim Otten <totten@civicrm.org>
Mon, 9 Feb 2015 13:22:05 +0000 (05:22 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 9 Feb 2015 18:33:51 +0000 (10:33 -0800)
Civi/API/Subscriber/DynamicFKAuthorization.php

index 3b7b83b2395ad8577093dd7795e3840f2870a2cd..4f94fb4ac6e0902f1def955400cfabc114e67e77 100644 (file)
@@ -123,7 +123,7 @@ class DynamicFKAuthorization implements EventSubscriberInterface {
    */
   public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) {
     $apiRequest = $event->getApiRequest();
-    if ($apiRequest['version'] == 3 && $apiRequest['entity'] == $this->entityName && in_array(strtolower($apiRequest['action']), $this->actions)) {
+    if ($apiRequest['version'] == 3 && strtolower($apiRequest['entity']) == strtolower($this->entityName) && in_array(strtolower($apiRequest['action']), $this->actions)) {
       if (/*!$isTrusted */
         empty($apiRequest['params']['id']) && empty($apiRequest['params']['entity_table'])
       ) {