summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-12-13 20:22:38 -0500
committerFrederic Guillot <fred@kanboard.net>2016-12-13 20:22:38 -0500
commitb6ea1ac9a4cfe4b56a9e226f6087945f01fc57b8 (patch)
treea9d13e78c28ce439ae1d34cfce770eeaa4696e15
parent5964d5cb13a85468800cdb45d5239cffb25b6e43 (diff)
parent2ed00b69a032018d15e1986e4cfe5c89f63206c9 (diff)
Merge pull-request #2890
-rw-r--r--app/Controller/ProjectFileController.php2
-rw-r--r--app/Controller/TaskFileController.php2
-rw-r--r--app/Controller/TaskImportController.php2
-rw-r--r--app/Controller/UserImportController.php2
-rw-r--r--app/functions.php10
5 files changed, 14 insertions, 4 deletions
diff --git a/app/Controller/ProjectFileController.php b/app/Controller/ProjectFileController.php
index cbe48679..9c38f684 100644
--- a/app/Controller/ProjectFileController.php
+++ b/app/Controller/ProjectFileController.php
@@ -21,7 +21,7 @@ class ProjectFileController extends BaseController
$this->response->html($this->template->render('project_file/create', array(
'project' => $project,
- 'max_size' => $this->helper->text->phpToBytes(ini_get('upload_max_filesize')),
+ 'max_size' => $this->helper->text->phpToBytes(get_upload_max_size()),
)));
}
diff --git a/app/Controller/TaskFileController.php b/app/Controller/TaskFileController.php
index 77c0c026..8a0971e4 100644
--- a/app/Controller/TaskFileController.php
+++ b/app/Controller/TaskFileController.php
@@ -40,7 +40,7 @@ class TaskFileController extends BaseController
$this->response->html($this->template->render('task_file/create', array(
'task' => $task,
- 'max_size' => $this->helper->text->phpToBytes(ini_get('upload_max_filesize')),
+ 'max_size' => $this->helper->text->phpToBytes(get_upload_max_size()),
)));
}
diff --git a/app/Controller/TaskImportController.php b/app/Controller/TaskImportController.php
index aff2d390..3ce275a5 100644
--- a/app/Controller/TaskImportController.php
+++ b/app/Controller/TaskImportController.php
@@ -27,7 +27,7 @@ class TaskImportController extends BaseController
'project' => $project,
'values' => $values,
'errors' => $errors,
- 'max_size' => ini_get('upload_max_filesize'),
+ 'max_size' => get_upload_max_size(),
'delimiters' => Csv::getDelimiters(),
'enclosures' => Csv::getEnclosures(),
'title' => t('Import tasks from CSV file'),
diff --git a/app/Controller/UserImportController.php b/app/Controller/UserImportController.php
index fec9a31d..6a9d5992 100644
--- a/app/Controller/UserImportController.php
+++ b/app/Controller/UserImportController.php
@@ -23,7 +23,7 @@ class UserImportController extends BaseController
$this->response->html($this->template->render('user_import/show', array(
'values' => $values,
'errors' => $errors,
- 'max_size' => ini_get('upload_max_filesize'),
+ 'max_size' => get_upload_max_size(),
'delimiters' => Csv::getDelimiters(),
'enclosures' => Csv::getEnclosures(),
)));
diff --git a/app/functions.php b/app/functions.php
index e732f308..9dd054fb 100644
--- a/app/functions.php
+++ b/app/functions.php
@@ -136,6 +136,16 @@ function build_app_version($ref, $commit_hash)
}
/**
+ * Get upload max size.
+ *
+ * @return string
+ */
+function get_upload_max_size()
+{
+ return min(ini_get('upload_max_filesize'), ini_get('post_max_size'));
+}
+
+/**
* Translate a string
*
* @return string