Ver código fonte

bugfix count on null..

andre 1 ano atrás
pai
commit
3658e32226

+ 6 - 5
app/Libs/Zimbra/Components/Api/Soap/Services/Create/CreateAccountCosQuota.php

@@ -92,12 +92,13 @@ class CreateAccountCosQuota extends CreateAccount
         /**
          * check if limit has been reached
          */
-        if ($cosLimits[$this->formData['cosId']] !== Size::UNLIMITED && count($groupedByCos[$this->formData['cosId']]) >= $cosLimits[$this->formData['cosId']] && $this->formData['cosId'] !== $this->formData['currentCosId'])
-        {
-            $this->setError('There are too many mailboxes with selected quota limit');
-            return false;
+        if(is_countable($groupedByCos[$this->formData['cosId']])) {
+            if ($cosLimits[$this->formData['cosId']] !== Size::UNLIMITED && count($groupedByCos[$this->formData['cosId']]) >= $cosLimits[$this->formData['cosId']] && $this->formData['cosId'] !== $this->formData['currentCosId'])
+            {
+                $this->setError('There are too many mailboxes with selected quota limit');
+                return false;
+            }
         }
-
         return true;
     }