* code for task #45184 and adjust api.
This commit is contained in:
@@ -115,7 +115,11 @@ class file extends control
|
||||
{
|
||||
if(session_id() != $this->app->sessionID) helper::restartSession($this->app->sessionID);
|
||||
$file = $this->file->getById($fileID);
|
||||
if(empty($file)) die("<html><head><meta charset='utf-8'></head><body>{$this->lang->file->fileNotFound}</body></html>");
|
||||
if(empty($file))
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => $this->lang->file->fileNotFound));
|
||||
die("<html><head><meta charset='utf-8'></head><body>{$this->lang->file->fileNotFound}</body></html>");
|
||||
}
|
||||
|
||||
/* Judge the mode, down or open. */
|
||||
$mode = 'down';
|
||||
@@ -156,6 +160,7 @@ class file extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => $this->lang->file->fileNotFound));
|
||||
die("<html><head><meta charset='utf-8'></head><body>{$this->lang->file->fileNotFound}</body></html>");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user