Bug #60627
closedTYPO3 // Install Tool / Check.php - checkMaximumFileUploadSize ignores the same value
100%
Description
Hi
I found a bug in the file typo3_src/typo3/sysext/install/Classes/SystemEnvironment/Check.php on line 186 (\TYPO3\CMS\Install\SystemEnvironment\Check::checkMaximumFileUploadSize)
The error message
It is recommended that the value of upload_max_filesize is at least equal to the value
But if I set the value in the php.ini to the same value TYPO3_CONF_VARS[BE][maxFileSize] the errors throws again (look to the attached screenshot)
The code must be changed as follows
// old compare if ($maximumUploadFilesize < $configuredMaximumUploadFilesize) { // new compare if ($maximumUploadFilesize <= $configuredMaximumUploadFilesize) {
Facts
TYPO3 Version: 6.2.3
Files
Updated by Markus Klein over 10 years ago
- Status changed from New to Needs Feedback
Please always update to the newest version. This has been fixed with 6.2.4, released on 8th of July.
Updated by Markus Klein over 10 years ago
Sorry mixed that up. The referenced fix was part of 6.2.2 actually.
Your suggested fix actually contradicts with the message of the OK-Status, so IMO the code is correct.
What values did you set in php.ini and what did you set in the Install Tool?
Updated by Christian Hünniger over 10 years ago
Hi Markus,
see the attached screen ( https://forge.typo3.org/attachments/download/27240/t3_install_tool_check.PNG ). I've set the value to 195M in the php.ini
The ok messeage is "PHP Maximum file upload size is higher than or equal to [BE][maxFileSize]" => "higher than or equal"
But egual is not possible, this is the bug.
Updated by Markus Klein over 10 years ago
Did you debug that? I suspect a rounding issue with the value calculated from the php config
Updated by Christian Hünniger over 10 years ago
Ok
You are correct. It seems like a rounding issue.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31873
Updated by Markus Klein over 10 years ago
- Status changed from Under Review to Needs Feedback
Please check if the pushed patch solves the issue.
Updated by Markus Klein over 10 years ago
Hm, looking at your debug output, I'd say your configuration is not correct.
Your TYPO3 config is 200000 (KB), that is of course not equal to 195 MB, as this is 195.3125 MB, or if you put into bytes 204800000 bytes.
195 MB = 204472320 bytes.
Updated by Christian Hünniger over 10 years ago
Ok
You are correct again ;)
This is the default value from TYPO3 (I've never changed this value) however, see attached debug_2 screen. Here you can see a wrong conversation / rounding.
Updated by Markus Klein over 10 years ago
This is no rounding issue. The code uses only bytes and not megabytes; there's no division in the code.
My first suspicion was that the calculation doubleval(php_ini_value) * 1024 * 1024 gives some weird numbers somewhere on the 10th decimal place, which would have corrupted the if-condition later. But in fact it does not, as we can see in your debug outputs.
Please set you php_value to 200000K or 200 MB and you're fine.
Updated by Markus Klein over 10 years ago
I'll change my patch to improve the message to show the value in KB.
Updated by Christian Hünniger over 10 years ago
Okay,
Thank you for your fast support.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Needs Feedback to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31873
Updated by Markus Klein over 10 years ago
You are welcome. Please test the patch and vote on Gerrit. Thanks
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31881
Updated by Markus Klein over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e172269f8db8720083c1e74eca03d9662a331185.