Conditions | 5 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public static function maximum_upload_size() |
||
31 | { |
||
32 | static $upload_size = null; |
||
33 | if ($upload_size === null) { |
||
34 | $post_max_size = self::str2bytes(ini_get('post_max_size')); |
||
35 | $upload_max_filesize = self::str2bytes(ini_get('upload_max_filesize')); |
||
36 | $memory_limit = self::str2bytes(ini_get('memory_limit')); |
||
37 | if (empty($post_max_size) && empty($upload_max_filesize) && empty($memory_limit)) { |
||
38 | return false; |
||
39 | } |
||
40 | $upload_size = min($post_max_size, $upload_max_filesize, $memory_limit); |
||
41 | } |
||
42 | return $upload_size; |
||
43 | } |
||
44 | } |