Less code to get the max post size from php.ini :)

This commit is contained in:
Peter Goodhall
2019-05-16 16:19:56 +01:00
parent 645eb395ce
commit 5eff3f015b
2 changed files with 2 additions and 5 deletions

View File

@@ -106,10 +106,7 @@ class adif extends CI_Controller {
{
$data['error'] = $this->upload->display_errors();
$max_upload = min(ini_get('post_max_size'), ini_get('upload_max_filesize'));
$max_upload = str_replace('M', '', $max_upload);
$data['max_upload'] = $max_upload * 1024;
$data['max_upload'] = ini_get('upload_max_filesize');
$this->load->view('interface_assets/header', $data);
$this->load->view('adif/import');

View File

@@ -26,7 +26,7 @@
<button type="submit" class="btn btn-primary mb-2" value="Upload">Upload</button>
</form>
<p><span class="badge badge-warning">Warning</span> Maximum file upload size is <?php echo $max_upload; ?> MB.</p>
<p><span class="badge badge-warning">Warning</span> Maximum file upload size is <?php echo $max_upload; ?>B.</p>
</div>
</div>