[wp-trac] [WordPress Trac] #9867: Fallback function htmlspecialchars_decode fails on Systems prior PHP 5.1.0

WordPress Trac wp-trac at lists.automattic.com
Mon May 18 20:10:48 GMT 2009


#9867: Fallback function htmlspecialchars_decode fails on Systems prior PHP 5.1.0
--------------------------+-------------------------------------------------
 Reporter:  unknown33     |       Owner:                                    
     Type:  defect (bug)  |      Status:  new                               
 Priority:  high          |   Milestone:  Unassigned                        
Component:  General       |     Version:  2.7.1                             
 Severity:  normal        |    Keywords:  compat.php htmlspecialchars_decode
--------------------------+-------------------------------------------------
 The fallback function htmlspecialchars_decode uses wrong variables.

 This bug happens in compat.php on systems using PHP prior 5.1.0.

 The problem is the check:

 if ( !is_scalar( $string ) ) {
 trigger_error( 'htmlspecialchars_decode() expects parameter 1 to be
 string, ' . gettype( $string ) . ' given', E_USER_WARNING );
                         return;
                 }

 this needs to be changed to:

 if ( !is_scalar( $str ) ) {
 trigger_error( 'htmlspecialchars_decode() expects parameter 1 to be
 string, ' . gettype( $str ) . ' given', E_USER_WARNING );
                         return;
                 }

 Means the variable $str is not used in the check.

 Cheers Dirk

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


More information about the wp-trac mailing list