summaryrefslogtreecommitdiff
path: root/app/Core/Http
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-30 22:25:16 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-30 22:25:16 -0500
commitbb040cfb78d53696edd63bf256d0fd8ba3ccdbfa (patch)
tree811d150fddd6220faabb3c1ea1743ffd7f781e45 /app/Core/Http
parent4a52d327f7e555c336a428c457cf40c3d97bfab3 (diff)
Simplify code to handle ajax popover and redirects
Diffstat (limited to 'app/Core/Http')
-rw-r--r--app/Core/Http/Response.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Core/Http/Response.php b/app/Core/Http/Response.php
index a0d8137b..d098f519 100644
--- a/app/Core/Http/Response.php
+++ b/app/Core/Http/Response.php
@@ -72,7 +72,7 @@ class Response extends Base
*/
public function redirect($url, $self = false)
{
- if ($this->request->getServerVariable('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest') {
+ if ($this->request->isAjax()) {
header('X-Ajax-Redirect: '.($self ? 'self' : $url));
} else {
header('Location: '.$url);