Opened 7 years ago
Closed 7 years ago
#47013 closed defect (bug) (fixed)
Editor: Warning when creating new page: "implode(): Invalid arguments"
| Reported by: | aduth | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.3 |
| Component: | Editor | Version: | 5.2 |
| Severity: | normal | Keywords: | good-first-bug has-patch needs-testing |
| Cc: | Focuses: |
Description
Previously: https://github.com/WordPress/gutenberg/issues/13875
The file edit-form-blocks.php calls implode on the result of a call to wp_set_post_lock. Per the documentation of the function, it can return a value of false which, when passed to implode, could result in a warning.
https://github.com/WordPress/wordpress-develop/blob/7bdef3d/src/wp-admin/edit-form-blocks.php#L252
https://developer.wordpress.org/reference/functions/wp_set_post_lock/
While it was not personally reproduced, presumably it could occur under the condition "if the post does not exist, or there is no current user" (from the documentation of wp_set_post_lock).
In any case, given the return type of wp_set_post_lock allowing for a boolean return value, it should not be passed directly into implode without first checking the type returned.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
@aduth I've created the patch for checking the type return of
wp_set_post_lock