Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"env:set" does not support non-alphabetical characters #33

Open
svytas opened this issue Aug 20, 2018 · 6 comments
Open

"env:set" does not support non-alphabetical characters #33

svytas opened this issue Aug 20, 2018 · 6 comments
Assignees

Comments

@svytas
Copy link

svytas commented Aug 20, 2018

Did you try to set a value with a plus character? The result will surprise you:
.env file:

MAIL_USERNAME=name@example.com
MAIL_PASSWORD=hy6gGbS+
MAIL_ENCRYPTION=tls

Executing command: php artisan env:set MAIL_PASSWORD ABCDEF+
Result file looks like this:

MAIL_USERNAME=name@example.com
MAIL_PASSWORD=ABCDEF+
+
MAIL_ENCRYPTION=tls

If your old value has other charaters, you get error:
.env file:

MAIL_USERNAME=name@example.com
MAIL_PASSWORD=hy6^gGbS+
MAIL_ENCRYPTION=tls

Executing command: php artisan env:set MAIL_PASSWORD ABCDEF+
got error Could not set the value in your .env file, reverting...

The problem is preg_replace function...

@svenluijten
Copy link
Owner

Ah, well spotted! Seems like you've already identified the bug, can you submit a PR to fix this? If not, I'll have a look at this later next week 🙂

@svytas
Copy link
Author

svytas commented Aug 29, 2018

Sorry @svenluijten, a little busy at this time for PR.

@svenluijten
Copy link
Owner

No worries @svytas! I'll pick it up as soon as I can make some time 😄

@svenluijten svenluijten changed the title There is a big bug in value set "env:set" does not support non-alphabetical characters Aug 29, 2018
@svenluijten svenluijten mentioned this issue Oct 2, 2018
@svenluijten
Copy link
Owner

fixed by #38

@svytas
Copy link
Author

svytas commented Oct 26, 2018

Hi, still it works strange - looks like I cannot change value if there are no numbers in it:

vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD 2
Successfully set [MAIL_PASSWORD] to [2] in your .env file.
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD 2A
Successfully set [MAIL_PASSWORD] to [2A] in your .env file.
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD A2
Successfully set [MAIL_PASSWORD] to [A2] in your .env file.
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD X2
Successfully set [MAIL_PASSWORD] to [X2] in your .env file.
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD X2X
Successfully set [MAIL_PASSWORD] to [X2X] in your .env file.
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD X2+X
Successfully set [MAIL_PASSWORD] to [X2+X] in your .env file.
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD XX
Could not set the value in your .env file, reverting...
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD XXDD
Could not set the value in your .env file, reverting...
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD AA
Could not set the value in your .env file, reverting...

@svenluijten svenluijten reopened this Oct 26, 2018
@svenluijten
Copy link
Owner

That's... very strange. This package desperately needs a rewrite / big refactor anyway, I'll see what I can do!

@svenluijten svenluijten self-assigned this Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants