From 65d3bff26a8e6342604f18caac70548f164a904d Mon Sep 17 00:00:00 2001 From: tianhe1986 Date: Fri, 22 Jun 2018 16:44:07 +0800 Subject: Using null comparison instead of isset(). Signed-off-by: tianhe1986 --- system/core/Input.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'system/core/Input.php') diff --git a/system/core/Input.php b/system/core/Input.php index 34f080899..81209d704 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -212,9 +212,8 @@ class CI_Input { */ public function post_get($index, $xss_clean = FALSE) { - return isset($_POST[$index]) - ? $this->post($index, $xss_clean) - : $this->get($index, $xss_clean); + $output = $this->post($index, $xss_clean); + return ($output !== NULL) ? $output : $this->get($index, $xss_clean); } // -------------------------------------------------------------------- @@ -228,9 +227,8 @@ class CI_Input { */ public function get_post($index, $xss_clean = FALSE) { - return isset($_GET[$index]) - ? $this->get($index, $xss_clean) - : $this->post($index, $xss_clean); + $output = $this->get($index, $xss_clean); + return ($output !== NULL) ? $output : $this->post($index, $xss_clean); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b