[wp-trac] [WordPress Trac] #4962: Orphan attachment's "parent_post"
seems to be undefined or overflowed
WordPress Trac
wp-trac at lists.automattic.com
Wed Sep 12 09:13:53 GMT 2007
#4962: Orphan attachment's "parent_post" seems to be undefined or overflowed
---------------------+------------------------------------------------------
Reporter: ulfben | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.4 (next)
Component: General | Version: 2.2.3
Severity: normal | Keywords: upload, attachment, parent_post, wp_posts, wp_upload_tab_upload_action
---------------------+------------------------------------------------------
Orphan attachment's "parent_post" seems to be undefined or overflowed
In `wp_posts` (the db table), parent_post defaults to NULL. An ordinary
post has no parent, and it's `parent_post` is set to 0 appropriately. Thus
an orphaned uploaded file (not attached to any post) should also be set to
0, right?
What I find is that they are all set to a value like -1189551062,
-1189547712, -1189551992 and so on, wich looks suspiciously like an
overflow of some kind.
Looking at `wp_upload_tab_upload_action()` I notice that `$post_id` is
never checked before constructing the attachment array. I don't know
enough PHP/MySQL/WP to know if this might be the cause or not, but I need
to know:
Are these (huge) negative `post_parent` id's a desired behaviour?
--
Ticket URL: <http://trac.wordpress.org/ticket/4962>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list