laravel-dotenv-editor
laravel-dotenv-editor copied to clipboard
2.0.7 add quote on value cause errors
adding quote while update value cause an error (ENV couldn't be readed) due to many quotes.
Tested on Laravel 5.4
on Mac OS X
solution: add quote only for value which contain space
character.
// ..
if(preg_match('/\s/',$value) > 0){
$value='"'.$value.'"';
}
//..
Hey, Thanks for the tip. Please create a pull request ;(
if (preg_match('/\s/', $value) > 0 && (strpos($value, '"') > 0 && strpos($value, '"', -0) > 0)) {
$value = '"' . $value . '"';
}
If value provided have empty space in string, contain quote in string and contain quote in last space, then add double quote on start and the end of string
"value to test" => value to test (when display)
am I mis-understanding on solution above?
If I didn't mis-understanding, a string contain empty space should be wrapped by double quote, but the truth is, when I save a value contain empty space into .env, bug below occurs because it didn't be wrapped by double quote...
Bug may occurs if empty space in .env
Uncaught ReflectionException: Class config does not exist in
@LostNCG having the same issues...