[wp-trac] [WordPress Trac] #24272: gallery_shortcode() can throw a "trying to get property of non-object" notice if called without a post context

WordPress Trac noreply at wordpress.org
Mon May 6 15:25:17 UTC 2013


#24272: gallery_shortcode() can throw a "trying to get property of non-object"
notice if called without a post context
--------------------------+-----------------------------
 Reporter:  kovshenin     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 The `gallery_shortcode()` function uses `$post->ID` without checking
 whether `get_post()` returned an actual post object. If called when a post
 context is not set, it throws a notice. To reproduce call this inside the
 [http://wordpress.org/extend/plugins/debug-bar-console/ Debug Bar
 Console]:

 {{{
 do_shortcode( '[gallery ids="1,2,3"]' );
 }}}

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


More information about the wp-trac mailing list