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

Fix getMaxFilesize() returning zero #33157

Merged
merged 1 commit into from Aug 14, 2019
Merged

Conversation

ausi
Copy link
Contributor

@ausi ausi commented Aug 14, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #32790
License MIT

With #32790 a BC break got introduced. Previously an empty upload_max_filesize returned PHP_INT_MAX but after the changes from #32790 it returns 0.

Setting upload_max_filesize or post_max_size to 0 or '' disables the limit so for both cases PHP_INT_MAX should be returned.

@ausi
Copy link
Contributor Author

ausi commented Aug 14, 2019

I didn’t find a way to mock the ini_get() function to create better tests. I tried a similar approach as the ClockMock class from the phpunit-bridge but it didn’t work as it seems that ini_get() cannot be overwritten with a namespaced function on the fly.

@fabpot
Copy link
Member

fabpot commented Aug 14, 2019

Thank you @ausi.

@fabpot fabpot merged commit f4c2ea5 into symfony:3.4 Aug 14, 2019
fabpot added a commit that referenced this pull request Aug 14, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

Fix getMaxFilesize() returning zero

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32790
| License       | MIT

With #32790 a BC break got introduced. Previously an empty `upload_max_filesize` returned `PHP_INT_MAX` but after the changes from #32790 it returns `0`.

Setting `upload_max_filesize` or `post_max_size` to `0` or `''` disables the limit so for both cases `PHP_INT_MAX` should be returned.

Commits
-------

f4c2ea5 Fix getMaxFilesize() returning zero
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Aug 14, 2019
This was referenced Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants