Fix BC break in 2.1.5dev - Revert to previous isRequired behavior for file upload inputs#4171
Fix BC break in 2.1.5dev - Revert to previous isRequired behavior for file upload inputs#4171cgmartin wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
I preserved what seemed to be the intent of #3983, but @ossinkine please look this over to make sure it's correct.
There was a problem hiding this comment.
Looks like the truth.
But the expression strlen($this->data[$name]) === 0 is unnecessary, because the expression is checked before.
There was a problem hiding this comment.
Thanks, good catch - I will remove that expression.
|
@ossinkine could you please comment and verify it matches original intent? |
|
Added update to remove unnecessary test from @ossinkine 's feedback. Should be good to go. |
Fix BC break in 2.1.5dev - Revert to previous isRequired behavior for file upload inputs
Forward port #4171 Conflicts: library/Zend/InputFilter/BaseInputFilter.php
|
Interestingly, this was already correct on develop -- due to a huge rewrite I did to the logic a few weeks ago to make it more readable and ensure the test cases were properly represented. :) |
|
@weierophinney much easier to follow what's going on. Nice! |
|
@cgmartin There was a conflict in behavior between two PRs, and the only way I could sort it out was to do that. :) |
|
@weierophinney Can you explain why do you need such validation in BaseInputFilter? Why not do the necessary checks directly in the Input? |
…/file-prg-base-input-filter Fix BC break in 2.1.5dev - Revert to previous isRequired behavior for file upload inputs
Forward port zendframework/zendframework#4171 Conflicts: library/Zend/InputFilter/BaseInputFilter.php
#3983 causes BC breaks for FilePostRedirectGet Plugin, and in existing projects using File Inputs with changed isRequired settings.
To reproduce, install https://github.com/cgmartin/ZF2FileUploadExamples and test the following examples:
With ZF2.1.4, the examples work correctly.
With ZF2.1.5dev, the examples fail.
Reported via email by @leup (Thanks!)