-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update .user.ini when setting upload size limit #17182
Conversation
👍 |
@DeepDiver1975 What do you think? |
$htaccess .= "\n" . $setting; | ||
|
||
$content = ''; | ||
while (!feof($handle)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use file_get_contents: https://secure.php.net/manual/de/function.file-get-contents.php
I guess it is possible
|
@MorrisJobke I used |
There was also a bug with checking the upper limit on the passed upload size. PHP does funny things with integer vs float comparisons, so our check didn't work. Now the check is much simpler, and ensures the value is sane.
4fa0463
to
aac84f7
Compare
A new inspection was created. |
Unit tests! There was also a bug with checking the upper limit on the passed upload size. PHP does funny things with integer vs float comparisons, so our check didn't work. Now the check is much simpler, and ensures the value is sane. Oh, there's also a new message in the admin panel that warns the admin that with PHP-FPM, the changes may take up to 5 minutes to take effect: http://php.net/manual/en/configuration.file.per-user.php#101705 |
@DeepDiver1975 @MorrisJobke Re-review please? |
@MorrisJobke Do you still think this should be using |
I'm fine with the way it is now. |
@DeepDiver1975 @MorrisJobke please review |
Tested and works 👍 (also with changed permissions) |
Update .user.ini when setting upload size limit
We try to change as many files as possible, so if we can write to
.user.ini
but not to.htaccess
then we will (but the file contents will become inconsistent). Of course, whichever one actually affects the installation will be shown in the upload limit box in the admin settings, so there is no ambiguity in what happened, and the logs clearly state if any files could not be written to.Not sure if this can be unit tested?
Fixes #14748
cc @PVince81 @LukasReschke @DeepDiver1975 @RealRancor @MorrisJobke