@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function setMinWidthSize($size) |
| 95 | 95 | {
|
| 96 | - $this->allowedImageSize[ 'width' ][ 'min' ] = (int)$size; |
|
| 96 | + $this->allowedImageSize['width']['min'] = (int)$size; |
|
| 97 | 97 | |
| 98 | 98 | return $this; |
| 99 | 99 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function setMaxWidthSize($size) |
| 111 | 111 | {
|
| 112 | - $this->allowedImageSize[ 'width' ][ 'max' ] = (int)$size; |
|
| 112 | + $this->allowedImageSize['width']['max'] = (int)$size; |
|
| 113 | 113 | |
| 114 | 114 | return $this; |
| 115 | 115 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function setMinHeightSize($size) |
| 127 | 127 | {
|
| 128 | - $this->allowedImageSize[ 'height' ][ 'min' ] = (int)$size; |
|
| 128 | + $this->allowedImageSize['height']['min'] = (int)$size; |
|
| 129 | 129 | |
| 130 | 130 | return $this; |
| 131 | 131 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function setMaxHeightSize($size) |
| 143 | 143 | {
|
| 144 | - $this->allowedImageSize[ 'height' ][ 'max' ] = (int)$size; |
|
| 144 | + $this->allowedImageSize['height']['max'] = (int)$size; |
|
| 145 | 145 | |
| 146 | 146 | return $this; |
| 147 | 147 | } |
@@ -160,45 +160,45 @@ discard block |
||
| 160 | 160 | if (parent::validate($file)) {
|
| 161 | 161 | |
| 162 | 162 | $info = getimagesize($file->getFileTemp()); |
| 163 | - $width = $info[ 0 ]; |
|
| 164 | - $height = $info[ 1 ]; |
|
| 163 | + $width = $info[0]; |
|
| 164 | + $height = $info[1]; |
|
| 165 | 165 | |
| 166 | 166 | /* Validate width min size */ |
| 167 | - if ($this->allowedImageSize[ 'width' ][ 'min' ] > 0) {
|
|
| 168 | - if ($width < $this->allowedImageSize[ 'width' ][ 'min' ]) {
|
|
| 167 | + if ($this->allowedImageSize['width']['min'] > 0) {
|
|
| 168 | + if ($width < $this->allowedImageSize['width']['min']) {
|
|
| 169 | 169 | $this->errors[] = language()->getLine( |
| 170 | 170 | 'IMAGE_E_ALLOWED_MIN_WIDTH_SIZE', |
| 171 | - [$this->allowedFileSize[ 'min' ], $width] |
|
| 171 | + [$this->allowedFileSize['min'], $width] |
|
| 172 | 172 | ); |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /* Validate width max size */ |
| 177 | - if ($this->allowedImageSize[ 'width' ][ 'max' ] > 0) {
|
|
| 178 | - if ($width > $this->allowedImageSize[ 'width' ][ 'max' ]) {
|
|
| 177 | + if ($this->allowedImageSize['width']['max'] > 0) {
|
|
| 178 | + if ($width > $this->allowedImageSize['width']['max']) {
|
|
| 179 | 179 | $this->errors[] = language()->getLine( |
| 180 | 180 | 'IMAGE_E_ALLOWED_MAX_WIDTH_SIZE', |
| 181 | - [$this->allowedFileSize[ 'max' ], $width] |
|
| 181 | + [$this->allowedFileSize['max'], $width] |
|
| 182 | 182 | ); |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /* Validate height min size */ |
| 187 | - if ($this->allowedImageSize[ 'height' ][ 'min' ] > 0) {
|
|
| 188 | - if ($height < $this->allowedImageSize[ 'width' ][ 'min' ]) {
|
|
| 187 | + if ($this->allowedImageSize['height']['min'] > 0) {
|
|
| 188 | + if ($height < $this->allowedImageSize['width']['min']) {
|
|
| 189 | 189 | $this->errors[] = language()->getLine( |
| 190 | 190 | 'IMAGE_E_ALLOWED_MIN_HEIGHT_SIZE', |
| 191 | - [$this->allowedFileSize[ 'min' ], $height] |
|
| 191 | + [$this->allowedFileSize['min'], $height] |
|
| 192 | 192 | ); |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /* Validate height max size */ |
| 197 | - if ($this->allowedImageSize[ 'height' ][ 'max' ] > 0) {
|
|
| 198 | - if ($height > $this->allowedImageSize[ 'width' ][ 'max' ]) {
|
|
| 197 | + if ($this->allowedImageSize['height']['max'] > 0) {
|
|
| 198 | + if ($height > $this->allowedImageSize['width']['max']) {
|
|
| 199 | 199 | $this->errors[] = language()->getLine( |
| 200 | 200 | 'IMAGE_E_ALLOWED_MAX_HEIGHT_SIZE', |
| 201 | - [$this->allowedFileSize[ 'max' ], $height] |
|
| 201 | + [$this->allowedFileSize['max'], $height] |
|
| 202 | 202 | ); |
| 203 | 203 | } |
| 204 | 204 | } |