Skip to content

Commit

Permalink
FIX The max size for upload file was not corectly shown
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 20, 2018
1 parent 497ab37 commit c6470d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions htdocs/core/class/html.formfile.class.php
Expand Up @@ -127,11 +127,12 @@ function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm
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);
$maxmin = $max;
if ($maxphp > 0) $maxmin=min($max,$maxphp);

if ($max > 0)
if ($maxmin > 0)
{
$out .= '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
$out .= '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
}

$out .= '<input class="flat minwidth400" type="file"';
Expand Down

0 comments on commit c6470d4

Please sign in to comment.