[wp-trac] [WordPress Trac] #7201: Dead code in maybe_serialize function

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 28 18:41:52 GMT 2008


#7201: Dead code in maybe_serialize function
-------------------------+--------------------------------------------------
 Reporter:  jacobsantos  |       Owner:  anonymous              
     Type:  defect       |      Status:  new                    
 Priority:  low          |   Milestone:  2.7                    
Component:  General      |     Version:  2.5                    
 Severity:  trivial      |    Keywords:  has-patch needs-testing
-------------------------+--------------------------------------------------
 Looking at the code of maybe_serialize() caused some confusion, because it
 doesn't appear that the code will ever execute as the first if branch will
 always evaluate serialized data to be true. This means that when the
 execution gets down to

 {{{
     if ( is_serialized( $data ) )   // <--- Always false
         return serialize( $data );  // <--- Dead Code
 }}}

 This probably needs to be moved up a bit to the top of the function body.

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


More information about the wp-trac mailing list