[wp-trac] [WordPress Trac] #17921: $curpage->post_parent and $curpage->post_name checks

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 28 19:34:23 UTC 2011


#17921: $curpage->post_parent and $curpage->post_name checks
--------------------------+-----------------------------
 Reporter:  adamnbowen    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.1.3
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 So I'm not entirely sure the "root cause" of the problem, but I've
 encountered an issue with wp-includes/post.php.  It seems to stem from the
 fact that there are not proper isset() checks being performed on
 properties of $curpage before they are accessed.

 Below is the backtrace (note that this was on v 3.1.3, which has different
 line numbers from my patch, which was on the svn trunk):

 Backtrace from warning 'Trying to get property of non-object' at
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/post.php 3163:
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/query.php 1600 calling get_page_by_path()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/query.php 1889 calling parse_query()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/query.php 2895 calling get_posts()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-includes
 /class-wp.php 454 calling query()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-includes
 /class-wp.php 501 calling query_posts()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/functions.php 1527 calling main()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-blog-
 header.php 14 calling wp()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/index.php 17
 calling require()

 Backtrace from warning 'Trying to get property of non-object' at
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/post.php 3158:
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/query.php 1600 calling get_page_by_path()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/query.php 1889 calling parse_query()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/query.php 2895 calling get_posts()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-includes
 /class-wp.php 454 calling query()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-includes
 /class-wp.php 501 calling query_posts()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-
 includes/functions.php 1527 calling main()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/wp-blog-
 header.php 14 calling wp()
         .
 /var/www/vhosts/wisdomadhesives.com/subdomains/dev/httpdocs/index.php 17
 calling require()

 Again, I'm not sure, but this may come from some of our own
 experimentation with taxonomies.

 Anyhow, I'm attaching the change I was able to make that solved the
 problem for me

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


More information about the wp-trac mailing list