[wp-trac] [WordPress Trac] #24477: _wp_preview_meta_filter should check if $post is empty

WordPress Trac noreply at wordpress.org
Sat Jun 1 13:49:47 UTC 2013


#24477: _wp_preview_meta_filter should check if $post is empty
--------------------------+-----------------------------
 Reporter:  itthinx       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Revisions     |    Version:  trunk
 Severity:  minor         |   Keywords:
--------------------------+-----------------------------
 The filter misses to check for empty( $post )  which can lead to problems
 when get_post_meta() is called during preview.

 Here is an example where this happens (note that in this example the
 Groups plugin is involved, but the issue is not dependent on the plugin) :


 {{{
 PHP Notice:  Trying to get property of non-object in /var/www/groups-
 newsletters/wp-includes/revision.php on line 543
 [01-Jun-2013 13:27:37] PHP Stack trace:
 [01-Jun-2013 13:27:37] PHP   1. {main}() /var/www/groups-
 newsletters/index.php:0
 [01-Jun-2013 13:27:37] PHP   2. require() /var/www/groups-
 newsletters/index.php:17
 [01-Jun-2013 13:27:37] PHP   3. wp() /var/www/groups-newsletters/wp-blog-
 header.php:14
 [01-Jun-2013 13:27:37] PHP   4. WP->main() /var/www/groups-newsletters/wp-
 includes/functions.php:779
 [01-Jun-2013 13:27:37] PHP   5. WP->query_posts() /var/www/groups-
 newsletters/wp-includes/class-wp.php:549
 [01-Jun-2013 13:27:37] PHP   6. WP_Query->query() /var/www/groups-
 newsletters/wp-includes/class-wp.php:485
 [01-Jun-2013 13:27:37] PHP   7. WP_Query->get_posts() /var/www/groups-
 newsletters/wp-includes/query.php:2985
 [01-Jun-2013 13:27:37] PHP   8. apply_filters_ref_array() /var/www/groups-
 newsletters/wp-includes/query.php:2785
 [01-Jun-2013 13:27:37] PHP   9. call_user_func_array() /var/www/groups-
 newsletters/wp-includes/plugin.php:230
 [01-Jun-2013 13:27:37] PHP  10. Groups_Post_Access::the_posts() /var/www
 /groups-newsletters/wp-includes/plugin.php:0
 [01-Jun-2013 13:27:37] PHP  11. Groups_Post_Access::user_can_read_post()
 /var/www/groups-newsletters/wp-content/plugins/groups/lib/access/class-
 groups-post-access.php:192
 [01-Jun-2013 13:27:37] PHP  12.
 Groups_Post_Access::get_read_post_capabilities() /var/www/groups-
 newsletters/wp-content/plugins/groups/lib/access/class-groups-post-
 access.php:360
 [01-Jun-2013 13:27:37] PHP  13. get_post_meta() /var/www/groups-
 newsletters/wp-content/plugins/groups/lib/access/class-groups-post-
 access.php:341
 [01-Jun-2013 13:27:37] PHP  14. get_metadata() /var/www/groups-newsletters
 /wp-includes/post.php:1715
 [01-Jun-2013 13:27:37] PHP  15. apply_filters() /var/www/groups-
 newsletters/wp-includes/meta.php:274
 [01-Jun-2013 13:27:37] PHP  16. call_user_func_array() /var/www/groups-
 newsletters/wp-includes/plugin.php:173
 [01-Jun-2013 13:27:37] PHP  17. _wp_preview_meta_filter() /var/www/groups-
 newsletters/wp-includes/plugin.php:0
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24477>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list