Small miscellaneous cleanup

This commit is contained in:
Timothy Warren 2016-04-19 13:23:49 -04:00
parent 741d9d0805
commit 1844f89e63
2 changed files with 9 additions and 3 deletions

View File

@ -134,8 +134,15 @@ class Controller {
*/ */
public function set_session_redirect($url = NULL) public function set_session_redirect($url = NULL)
{ {
$server_params = $this->request->getServerParams();
if ( ! array_key_exists('HTTP_REFERER', $server_params))
{
return;
}
$anime_client = $this->container->get('anime-client'); $anime_client = $this->container->get('anime-client');
$double_form_page = $this->request->getServerParams()['HTTP_REFERER'] == $this->request->getUri(); $double_form_page = $server_params['HTTP_REFERER'] == $this->request->getUri();
// Don't attempt to set the redirect url if // Don't attempt to set the redirect url if
// the page is one of the form type pages, // the page is one of the form type pages,
@ -149,7 +156,7 @@ class Controller {
{ {
$url = ($anime_client->is_view_page()) $url = ($anime_client->is_view_page())
? $this->request->url->get() ? $this->request->url->get()
: $this->request->getServerParams()['HTTP_REFERER']; : $server_params['HTTP_REFERER'];
} }
$this->session->set('redirect_url', $url); $this->session->set('redirect_url', $url);

View File

@ -13,7 +13,6 @@
namespace Aviat\Ion\Cache\Driver; namespace Aviat\Ion\Cache\Driver;
use Aviat\Ion\Di\ContainerInterface; use Aviat\Ion\Di\ContainerInterface;
use Aviat\Ion\Json;
use Aviat\AnimeClient\Model\DB; use Aviat\AnimeClient\Model\DB;
/** /**