git subrepo commit (merge) mailcow/src/mailcow-dockerized

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "f83239ed"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "7627a7a9"
git-subrepo: version:  "0.4.6"
  origin:   "???"
  commit:   "???"
Change-Id: I88e430779f11ac9848e81a9e4eae549100ed1f94
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php b/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php
index 0da8c35..b729235 100644
--- a/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php
@@ -2,6 +2,7 @@
 function customize($_action, $_item, $_data = null) {

 	global $redis;

 	global $lang;

+  global $LOGO_LIMITS;

   

   switch ($_action) {

     case 'add':

@@ -35,6 +36,23 @@
                 );

                 return false;

               }

+              if ($_data[$_item]['size'] > $LOGO_LIMITS['max_size']) {

+                $_SESSION['return'][] = array(

+                  'type' => 'danger',

+                  'log' => array(__FUNCTION__, $_action, $_item, $_data),

+                  'msg' => 'img_size_exceeded'

+                );

+                return false;

+              }

+              list($width, $height) = getimagesize($_data[$_item]['tmp_name']);

+              if ($width > $LOGO_LIMITS['max_width'] || $height > $LOGO_LIMITS['max_height']) {

+                $_SESSION['return'][] = array(

+                  'type' => 'danger',

+                  'log' => array(__FUNCTION__, $_action, $_item, $_data),

+                  'msg' => 'img_dimensions_exceeded'

+                );

+                return false;

+              }

               $image = new Imagick($_data[$_item]['tmp_name']);

               if ($image->valid() !== true) {

                 $_SESSION['return'][] = array(