Opened 6 years ago
Closed 6 years ago
#47013 closed defect (bug) (fixed)
Editor: Warning when creating new page: "implode(): Invalid arguments"
Reported by: | aduth | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Editor | Keywords: | good-first-bug has-patch needs-testing |
Focuses: | Cc: |
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.
Attachments (1)
Change History (6)
#1
@
6 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
@aduth I've created the patch for checking the return type of
wp_set_post_lock