[wp-trac] [WordPress Trac] #29920: Autosave breaks if post revision fields contains a value that isn't a string

WordPress Trac noreply at wordpress.org
Thu Jul 2 03:35:52 UTC 2015


#29920: Autosave breaks if post revision fields contains a value that isn't a
string
--------------------------+------------------------------
 Reporter:  mattheu       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Revisions     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by mboynes):

 As it turns out, this comes up in a few places:

 1.
 [https://github.com/WordPress/WordPress/blob/c919a1c1e91fa77f61435db2cf6006e6eb645efd
 /wp-admin/includes/post.php#L1642-L1647 wp-admin/includes/post.php] (as
 originally noted in this ticket)
 2.
 [https://github.com/WordPress/WordPress/blob/c919a1c1e91fa77f61435db2cf6006e6eb645efd
 /wp-includes/revision.php#L130-L135 wp-includes/revision.php]
 3.
 [https://github.com/WordPress/WordPress/blob/c919a1c1e91fa77f61435db2cf6006e6eb645efd
 /wp-admin/edit-form-advanced.php#L157-L162 wp-admin/edit-form-
 advanced.php]

 Furthermore, the current code assumes that every field is singular
 (calling `$post->$meta_key` triggers a
 [https://github.com/WordPress/WordPress/blob/c919a1c1e91fa77f61435db2cf6006e6eb645efd
 /wp-includes/post.php#L748 `get_post_meta()` call with `true` as the third
 param]). If you have more than one meta value for a given key, only the
 first will be used and the rest ignored.

 I think the ultimate solution to this ticket needs to be a bit more robust
 to cover all of these issues, while also DRYing up this code.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29920#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list