Opened 10 years ago
Closed 9 years ago
#36170 closed enhancement (fixed)
Small refactor in the validate_file method + unit tests
| Reported by: | borgesbruno | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Filesystem API | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
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
@
10 years ago
I've removed the type hint, because is also necessary to do the refactor for
validate_file_to_edit method.
#5
@
10 years ago
- Component General → 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
@
10 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 =)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch 36170