Opened 9 years ago
Closed 7 years ago
#36170 closed enhancement (fixed)
Small refactor in the validate_file method + unit tests
Reported by: | borgesbruno | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Filesystem API | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
The validate_file( $file, $allowed_files = '' )
method has as third param an array of allowed files, but the default value is a string, I created this patch using as default value an empty array instead of a empty string.
Beyond that, I wrote some unit tests for this change and to improve de code coverage.
Attachments (4)
Change History (13)
#2
@
9 years ago
I've removed the type hint, because is also necessary to do the refactor for
validate_file_to_edit
method.
#5
@
8 years ago
- Component changed from General to Filesystem API
- Keywords needs-refresh added; dev-feedback removed
@borgesbruno Thanks for your patch and the unit tests.
Can you please adjust your patch according our coding standards?
Let's change the default value for validate_file_to_edit()
too.
#6
@
8 years ago
- Keywords dev-feedback added; needs-refresh removed
Tks for your feedback @ocean90, to avoid theses small errors with codings standards, now I'm using the phpcs with WordPress standard mode.
I've fixed theses errors on the last patch, please, if you can review again =)
Patch 36170