Remove global variable

This commit is contained in:
Frederic Guillot 2016-01-16 22:07:46 -05:00
parent 5a6cd48df1
commit ff149c354e
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class Response extends Base
public function status($status_code)
{
header('Status: '.$status_code);
header($_SERVER['SERVER_PROTOCOL'].' '.$status_code);
header($this->request->getServerVariable('SERVER_PROTOCOL').' '.$status_code);
}
/**
@ -71,7 +71,7 @@ class Response extends Base
*/
public function redirect($url)
{
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') {
if ($this->request->getServerVariable('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest') {
header('X-Ajax-Redirect: '.$url);
} else {
header('Location: '.$url);