From bb040cfb78d53696edd63bf256d0fd8ba3ccdbfa Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 30 Jan 2016 22:25:16 -0500 Subject: Simplify code to handle ajax popover and redirects --- app/Core/Http/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Core/Http') 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); -- cgit v1.2.3