Skip to content

Commit

Permalink
add env filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
desmondchoon committed Feb 10, 2020
1 parent 65eb6a8 commit 1e6e3b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

function env($env, $default=false){
if(getenv($env)){
return getenv($env);
$env = getenv($env);
if(preg_match('/^(["\']).*\1$/m', $env)){
$env = str_replace('"', '', $env);
$env = str_replace("'", '', $env);
}else{
$env = str_replace("\n", '', $env); // remove new lines
$env = str_replace("\r", '', $env);
}
return $env;
}else{
if($default){
return $default;
Expand Down

0 comments on commit 1e6e3b3

Please sign in to comment.