WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 18 months ago

#9867 closed defect (bug) (duplicate)

Fallback function htmlspecialchars_decode fails on Systems prior PHP 5.1.0

Reported by: unknown33 Owned by:
Milestone: Priority: high
Severity: normal Version: 2.7.1
Component: General Keywords: compat.php htmlspecialchars_decode
Focuses: Cc:

Description

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

Change History (2)

comment:1 @ryan6 years ago

  • Milestone Unassigned deleted
  • Resolution set to duplicate
  • Status changed from new to closed

See #9090 and #9475

comment:2 @ircbot18 months ago

This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.

Note: See TracTickets for help on using tickets.