summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-07-13 21:47:56 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-13 21:47:56 +0200
commit3bd289a3c14f377c3c689f97cf20366571f6add9 (patch)
tree9b523be2327def5e18c6a22e6084bbae570f5277 /application/controllers/file.php
parentf67a3cf212a774945a0d10143e93071e19dc40f4 (diff)
Throw public exception when accessing CLI only functions
We actually don't need to hide this from the user. The error should be shown rather than a blank page being returned. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 328fc551f..e1f37e0e8 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -1066,7 +1066,7 @@ class File extends MY_Controller {
// Removes old files
function cron()
{
- if (!$this->input->is_cli_request()) return;
+ $this->_require_cli_request();
$tarball_dir = $this->config->item("upload_path")."/special/multipaste-tarballs";
if (is_dir($tarball_dir)) {
@@ -1124,7 +1124,7 @@ class File extends MY_Controller {
/* remove files without database entries */
function clean_stale_files()
{
- if (!$this->input->is_cli_request()) return;
+ $this->_require_cli_request();
$upload_path = $this->config->item("upload_path");
$outer_dh = opendir($upload_path);
@@ -1178,7 +1178,7 @@ class File extends MY_Controller {
function nuke_id()
{
- if (!$this->input->is_cli_request()) return;
+ $this->_require_cli_request();
$id = $this->uri->segment(3);
@@ -1196,7 +1196,7 @@ class File extends MY_Controller {
function update_file_metadata()
{
- if (!$this->input->is_cli_request()) return;
+ $this->_require_cli_request();
$chunk = 500;