[wp-trac] [WordPress Trac] #47013: Editor: Warning when creating new page: "implode(): Invalid arguments"
WordPress Trac
noreply at wordpress.org
Mon Apr 22 18:22:50 UTC 2019
#47013: Editor: Warning when creating new page: "implode(): Invalid arguments"
--------------------------+-----------------------------
Reporter: aduth | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47013>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list