summaryrefslogtreecommitdiffstats
path: root/application/core
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-09-26 13:46:14 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-09-26 13:46:14 +0200
commit3ff6ffa3341c876b741feb66552cdd110b67872e (patch)
tree69e11cd0009ddd1346f2dc4cd8c47244368db28e /application/core
parentbc2f7f596f727e204e8b8c5b849545745b3cbfaa (diff)
parent81a4c8c630ef59cffea0c24e64fb6fa7f09bfcf6 (diff)
Merge CodeIgniter 3 support
Diffstat (limited to 'application/core')
-rw-r--r--application/core/MY_Controller.php8
-rw-r--r--application/core/MY_Input.php4
-rw-r--r--application/core/index.html3
3 files changed, 8 insertions, 7 deletions
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php
index 47dd6a899..463a4df64 100644
--- a/application/core/MY_Controller.php
+++ b/application/core/MY_Controller.php
@@ -20,7 +20,7 @@ class MY_Controller extends CI_Controller {
$this->load->library('customautoloader');
// check if DB is up to date
- if (!($this->input->is_cli_request() && $this->uri->segment(1) === "tools")) {
+ if (!(is_cli() && $this->uri->segment(1) === "tools")) {
$this->_ensure_database_schema_up_to_date();
}
@@ -54,7 +54,7 @@ class MY_Controller extends CI_Controller {
protected function _require_cli_request()
{
- if (!$this->input->is_cli_request()) {
+ if (!is_cli()) {
throw new \exceptions\PublicApiException("api/cli-only", "This function can only be accessed via the CLI interface");
}
}
@@ -79,7 +79,7 @@ class MY_Controller extends CI_Controller {
private function _check_csrf_protection_required()
{
- if ($this->input->post("apikey") !== false || is_api_client()) {
+ if ($this->input->post("apikey") !== null || is_api_client()) {
/* This relies on the authentication code always verifying the supplied
* apikey. If the key is not verified/logged in an attacker could simply
* add an empty "apikey" field to the CSRF form to circumvent the
@@ -106,7 +106,7 @@ class MY_Controller extends CI_Controller {
return false;
}
- if ($this->input->is_cli_request()) {
+ if (is_cli()) {
return false;
}
diff --git a/application/core/MY_Input.php b/application/core/MY_Input.php
index 4d43774c0..5a08ea4bb 100644
--- a/application/core/MY_Input.php
+++ b/application/core/MY_Input.php
@@ -26,8 +26,8 @@ class MY_Input extends CI_Input {
public function post_array($key) {
$ret = parent::post($key);
- if ($ret === false) {
- return false;
+ if ($ret === null) {
+ return null;
} elseif (!is_array($ret)) {
$data = [
"key" => $key,
diff --git a/application/core/index.html b/application/core/index.html
index c942a79ce..b702fbc39 100644
--- a/application/core/index.html
+++ b/application/core/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>