[wp-trac] [WordPress Trac] #14572: post_author_meta_box causes fatal error on site with large userbase.

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 5 13:55:36 UTC 2010


#14572: post_author_meta_box causes fatal error on site with large userbase.
----------------------------+-----------------------------------------------
 Reporter:  tomdebruin      |       Owner:  scribu          
     Type:  defect (bug)    |      Status:  assigned        
 Priority:  normal          |   Milestone:  3.1             
Component:  Administration  |     Version:  3.0.1           
 Severity:  normal          |    Keywords:  needs-patch gsoc
----------------------------+-----------------------------------------------

Comment(by filosofo):

 From [15565] :
 {{{
         4234
         4235        foreach ( $queries as $query ) {
         4236            $meta_key = trim( @$query['meta_key'] );
         4237            $meta_value = trim( @$query['meta_value'] );
         4238            $meta_compare = @$query['meta_compare'];
         4239
         4240            if ( empty( $meta_compare ) || !in_array(
 $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'like' ) ) )
         4241                $meta_compare = '=';
         4242
         4243            if ( empty( $meta_key ) )
         4244                continue;
         4245
 }}}

 I don't think suppressing errors is the best way of the handling the
 arguments here. If `$query['meta_key']` is an array, then `$meta_key` will
 be set to the string "Array", which defeats the point of lines 4243ff.
 And that situation would be difficult to debug with no error messages.

 In general, I would suggest that we suppress errors---if at all---only
 when dealing with external resources.  For example, the call to
 PHPMailer's send in `wp_mail`.  That makes sense because a lot of the
 potential problems have to do with things outside of WP's purview, such as
 server configuration.

 Here if we have a type mismatch we ''want'' to find out, or we want to
 check for it in the first place.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14572#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list