Bug #60627

TYPO3 // Install Tool / Check.php - checkMaximumFileUploadSize ignores the same value

Added by Christian Hünniger almost 8 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
Start date:
2014-07-27
Due date:
% Done:

100%

Estimated time:
0.50 h
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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

t3_install_tool_check.PNG (28.7 KB) t3_install_tool_check.PNG Christian Hünniger, 2014-07-27 22:14
t3_install_tool_check_debug.PNG (50.1 KB) t3_install_tool_check_debug.PNG Christian Hünniger, 2014-07-27 22:44
t3_install_tool_check_debug_2.PNG (57.3 KB) t3_install_tool_check_debug_2.PNG Christian Hünniger, 2014-07-27 22:54

Related issues

Related to TYPO3 Core - Bug #58260: Installtool-Check "checkMaximumFileUploadSize" doesn't look at BE/maxFileSize, but message suggests thatClosed2014-04-27

Actions
#1

Updated by Markus Klein almost 8 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.

#2

Updated by Markus Klein almost 8 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?

#3

Updated by Christian Hünniger almost 8 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.

#4

Updated by Markus Klein almost 8 years ago

Did you debug that? I suspect a rounding issue with the value calculated from the php config

#5

Updated by Christian Hünniger almost 8 years ago

Ok

You are correct. It seems like a rounding issue.

#6

Updated by Gerrit Code Review almost 8 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

#7

Updated by Markus Klein almost 8 years ago

  • Status changed from Under Review to Needs Feedback

Please check if the pushed patch solves the issue.

#8

Updated by Markus Klein almost 8 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.

#9

Updated by Christian Hünniger almost 8 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.

#10

Updated by Markus Klein almost 8 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.

#11

Updated by Markus Klein almost 8 years ago

I'll change my patch to improve the message to show the value in KB.

#12

Updated by Christian Hünniger almost 8 years ago

Okay,

Thank you for your fast support.

#13

Updated by Gerrit Code Review almost 8 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

#14

Updated by Markus Klein almost 8 years ago

You are welcome. Please test the patch and vote on Gerrit. Thanks

#15

Updated by Gerrit Code Review almost 8 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

#16

Updated by Markus Klein almost 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#17

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF