From 5e097e9d893551c5111e818a27a41347c761affa Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 9 Jan 2018 07:09:16 -0600 Subject: [PATCH] add the exit() to the env file in a better way, add some more htaccess rules to block the env file --- .htaccess | 2 ++ modules/Installer/Resources/views/stubs/env.blade.php | 2 -- modules/Installer/Services/EnvironmentService.php | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index d3a7c5e4..d8b312ce 100755 --- a/.htaccess +++ b/.htaccess @@ -25,6 +25,8 @@ RedirectMatch 403 ^/composer.json RedirectMatch 403 ^/composer.lock RedirectMatch 403 ^/composer.phar RedirectMatch 403 ^/env.php.*?$ +RedirectMatch 403 ^/env.php +RedirectMatch 403 ^/env.php$ RedirectMatch 403 ^/Makefile RedirectMatch 403 ^/package.json RedirectMatch 403 ^/package-lock.json diff --git a/modules/Installer/Resources/views/stubs/env.blade.php b/modules/Installer/Resources/views/stubs/env.blade.php index bd8a6edf..ca093249 100644 --- a/modules/Installer/Resources/views/stubs/env.blade.php +++ b/modules/Installer/Resources/views/stubs/env.blade.php @@ -1,5 +1,3 @@ - - # # Before you go live, remember to change the APP_ENV to production # and APP_DEBUG to false. Adjust logging to taste diff --git a/modules/Installer/Services/EnvironmentService.php b/modules/Installer/Services/EnvironmentService.php index 645449ab..d07a6a71 100644 --- a/modules/Installer/Services/EnvironmentService.php +++ b/modules/Installer/Services/EnvironmentService.php @@ -127,6 +127,9 @@ class EnvironmentService $env_contents = view('installer::stubs/env', $opts); Log::info($env_contents); + $env_contents = "\n\n" + .$env_contents; + fwrite($fp, $env_contents); fclose($fp); }