diff --git a/config/app.php b/config/app.php index 1ced8bef0a14..458cfc898dd6 100644 --- a/config/app.php +++ b/config/app.php @@ -61,6 +61,8 @@ 'asset_url' => env('ASSET_URL'), + 'allow_referer_header' => true, + /* |-------------------------------------------------------------------------- | Application Timezone diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index 4808c1c0a89e..c04b47d0fa2a 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -161,7 +161,9 @@ public function current() */ public function previous($fallback = false) { - $referrer = $this->request->headers->get('referer'); + $referrer = config('app.allow_referer_header', true) + ? $this->request->headers->get('referer') + : null; $url = $referrer ? $this->to($referrer) : $this->getPreviousUrlFromSession();