feat(core): cast valid booleans when setting system configs#58868
feat(core): cast valid booleans when setting system configs#58868
Conversation
come-nc
left a comment
There was a problem hiding this comment.
But that would mean when setting a configuration to "false" or "true" it would automagically decide that it’s a boolean even if we indicated type string?
That seems dangerous to me.
Maybe output a warning but do not change the type on the fly.
Otherwise how would one set a configuration to the string "true", it would not be possible anymore?
We do not have any |
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
cee3001 to
d26bf95
Compare
artonge
left a comment
There was a problem hiding this comment.
I just saw that Côme had the same comment. Given your answer, I say let's go!
We do not have any what? String in the configuration? If the dbuser is named "true" or it’s the smtp password or whatever, now the command will silently set it to a boolean despite being called with |
|
Given we already cast at the explicit direction of the user prior to this if server/core/Command/Config/System/SetConfig.php Lines 61 to 66 in d26bf95 e.g. Also little weird if we only do this for
This ^^^. And P.S. Also it hadn't occurred to me how distinct server/core/Command/Config/App/SetConfig.php Lines 95 to 100 in d26bf95 server/core/Command/Config/App/SetConfig.php Lines 120 to 138 in d26bf95 |
|
Also config.sample.php is not complete, see #59911 |
I think we could be smarter with primitive values like those 🙈
Checklist
3. to review, feature component)stable32)AI (if applicable)