Skip to content

Commit

Permalink
Update html.formfile.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Mar 3, 2016
1 parent 40144ee commit 902eba6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions htdocs/core/class/html.formfile.class.php
Expand Up @@ -109,7 +109,10 @@ function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm

$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1;
if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024;
if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024;
if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024;
// Now $max and $maxphp are in Kb
if ($maxphp > 0) $max=min($max,$maxphp);

Expand Down

0 comments on commit 902eba6

Please sign in to comment.