Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7ade86485 |
@@ -27,7 +27,9 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9",
|
"phpunit/phpunit": "^9",
|
||||||
"phpstan/phpstan": "^1.10",
|
"phan/phan": "^5.4",
|
||||||
"phan/phan": "^5.4"
|
"phpstan/phpstan": "^2.0",
|
||||||
|
"phpstan/phpdoc-parser": "^2.0",
|
||||||
|
"phpstan/phpstan-deprecation-rules": "^2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class DotEnv
|
|||||||
$block = false;
|
$block = false;
|
||||||
$var = '';
|
$var = '';
|
||||||
$prefix_name = '';
|
$prefix_name = '';
|
||||||
while ($line = fgets($fp)) {
|
while (($line = fgets($fp)) !== false) {
|
||||||
// [] block must be a single line, or it will be ignored
|
// [] block must be a single line, or it will be ignored
|
||||||
if (preg_match("/^\s*\[([\w_.\s]+)\]/", $line, $matches)) {
|
if (preg_match("/^\s*\[([\w_.\s]+)\]/", $line, $matches)) {
|
||||||
$prefix_name = preg_replace("/\s+/", "_", $matches[1]) . ".";
|
$prefix_name = preg_replace("/\s+/", "_", $matches[1]) . ".";
|
||||||
@@ -104,6 +104,9 @@ class DotEnv
|
|||||||
// just be sure it is init before we fill
|
// just be sure it is init before we fill
|
||||||
if (!isset($_ENV[$var])) {
|
if (!isset($_ENV[$var])) {
|
||||||
$_ENV[$var] = '';
|
$_ENV[$var] = '';
|
||||||
|
} elseif (!is_string($_ENV[$var])) {
|
||||||
|
// if this is not string, skip
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
// strip line of slashes
|
// strip line of slashes
|
||||||
$_ENV[$var] .= stripslashes($line);
|
$_ENV[$var] .= stripslashes($line);
|
||||||
|
|||||||
Reference in New Issue
Block a user