summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Input.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 52ea71bc5..6f88b1972 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -624,6 +624,21 @@ class CI_Input {
return $this->headers[$index];
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Is ajax Request?
+ *
+ * Test to see if a request contains the HTTP_X_REQUESTED_WITH header
+ *
+ * @return boolean
+ */
+ public function is_ajax_request()
+ {
+ $req_source = $this->server('HTTP_X_REQUESTED_WITH');
+ return ($req_source == 'XMLHttpRequest') ? TRUE : FALSE;
+ }
+
}
// END Input class