mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed a bug where the referer might not be picked up correctly.
This commit is contained in:
parent
538018fed1
commit
f89aee37f5
@ -90,9 +90,16 @@ class HomeController extends BaseController
|
|||||||
public function sessionNext()
|
public function sessionNext()
|
||||||
{
|
{
|
||||||
Navigation::next();
|
Navigation::next();
|
||||||
if (isset($_SERVER['HTTP_REFERER']) && (!strpos($_SERVER['HTTP_REFERER'], Config::get('app.url')) === false)) {
|
$strPosition = strpos($_SERVER['HTTP_REFERER'], Config::get('app.url'));
|
||||||
|
Log::debug('HTTP_REFERER is: ' . $_SERVER['HTTP_REFERER']);
|
||||||
|
Log::debug('App.url = ' . Config::get('app.url'));
|
||||||
|
Log::debug('strpos() = ' . Steam::boolString($strPosition));
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_REFERER']) && $strPosition === 0) {
|
||||||
|
Log::debug('Redirect back');
|
||||||
return Redirect::back();
|
return Redirect::back();
|
||||||
} else {
|
} else {
|
||||||
|
Log::debug('Redirect intended');
|
||||||
return Redirect::intended();
|
return Redirect::intended();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,10 +111,17 @@ class HomeController extends BaseController
|
|||||||
public function sessionPrev()
|
public function sessionPrev()
|
||||||
{
|
{
|
||||||
Navigation::prev();
|
Navigation::prev();
|
||||||
|
$strPosition = strpos($_SERVER['HTTP_REFERER'], Config::get('app.url'));
|
||||||
|
Log::debug('HTTP_REFERER is: ' . $_SERVER['HTTP_REFERER']);
|
||||||
|
Log::debug('App.url = ' . Config::get('app.url'));
|
||||||
|
Log::debug('strpos() = ' . Steam::boolString($strPosition));
|
||||||
|
|
||||||
if (isset($_SERVER['HTTP_REFERER']) && (!strpos($_SERVER['HTTP_REFERER'], Config::get('app.url')) === false)) {
|
|
||||||
|
if (isset($_SERVER['HTTP_REFERER']) && $strPosition === 0) {
|
||||||
|
Log::debug('Redirect back');
|
||||||
return Redirect::back();
|
return Redirect::back();
|
||||||
} else {
|
} else {
|
||||||
|
Log::debug('Redirect intended');
|
||||||
return Redirect::intended();
|
return Redirect::intended();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user