diff options
| author | Chad Parry <github@chad.parry.org> | 2011-04-24 08:28:39 -0600 | 
|---|---|---|
| committer | Chad Parry <github@chad.parry.org> | 2011-04-24 08:28:39 -0600 | 
| commit | 26585fed03236f0f70a75959e1d3002025f4e15e (patch) | |
| tree | 33a89567f40dbbdb8affcbe76baa27b242bc6d75 /modules/gallery/libraries/Form_Uploadify.php | |
| parent | 809567f12850f59bdeb47a2963f6968b99b5a201 (diff) | |
| parent | c8f90e861b866d0caa86343a6c7213e923023d39 (diff) | |
Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto
Diffstat (limited to 'modules/gallery/libraries/Form_Uploadify.php')
| -rw-r--r-- | modules/gallery/libraries/Form_Uploadify.php | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/modules/gallery/libraries/Form_Uploadify.php b/modules/gallery/libraries/Form_Uploadify.php index ca189f0b..c79b9aa2 100644 --- a/modules/gallery/libraries/Form_Uploadify.php +++ b/modules/gallery/libraries/Form_Uploadify.php @@ -49,6 +49,20 @@ class Form_Uploadify_Core extends Form_Input {      $v->movies_allowed = (bool) movie::find_ffmpeg();      $v->extensions = upload::get_upload_filters();      $v->suhosin_session_encrypt = (bool) ini_get("suhosin.session.encrypt"); + +    list ($toolkit_max_filesize_bytes, $toolkit_max_filesize) = graphics::max_filesize(); + +    $upload_max_filesize = trim(ini_get("upload_max_filesize")); +    $upload_max_filesize_bytes = num::convert_to_bytes($upload_max_filesize); + +    if ($upload_max_filesize_bytes < $toolkit_max_filesize_bytes) { +      $v->size_limit_bytes = $upload_max_filesize_bytes; +      $v->size_limit = $upload_max_filesize; +    } else { +      $v->size_limit_bytes = $toolkit_max_filesize_bytes; +      $v->size_limit = $toolkit_max_filesize; +    } +      return $v;    } | 
