Skip to content

Commit 1e6e3b3

Browse files
committed
add env filtering
1 parent 65eb6a8 commit 1e6e3b3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bootstrap/app.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
function env($env, $default=false){
44
if(getenv($env)){
5-
return getenv($env);
5+
$env = getenv($env);
6+
if(preg_match('/^(["\']).*\1$/m', $env)){
7+
$env = str_replace('"', '', $env);
8+
$env = str_replace("'", '', $env);
9+
}else{
10+
$env = str_replace("\n", '', $env); // remove new lines
11+
$env = str_replace("\r", '', $env);
12+
}
13+
return $env;
614
}else{
715
if($default){
816
return $default;

0 commit comments

Comments
 (0)