| Conditions | 7 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public static function maxDimension($check, $height, $width) |
||
| 19 | { |
||
| 20 | if (is_array($check) && isset($check['error']) && (int)$check['error'] === UPLOAD_ERR_NO_FILE) { |
||
| 21 | return true; |
||
| 22 | } |
||
| 23 | |||
| 24 | if (!is_file($check['tmp_name'])) { |
||
| 25 | return false; |
||
| 26 | } |
||
| 27 | |||
| 28 | //@codingStandardsIgnoreStart |
||
| 29 | $size = @getimagesize($check['tmp_name']); |
||
| 30 | //@codingStandardsIgnoreEnd |
||
| 31 | |||
| 32 | if (!is_array($size)) { |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | |||
| 36 | return ($size[0] <= (int)$width && $size[1] <= (int)$height); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |