WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9090 closed defect (bug) (fixed)

validation broken in htmlspecialchars_decode replacement function

Reported by: stringfold Owned by:
Milestone: 2.7.2 Priority: high
Severity: normal Version:
Component: Validation Keywords: compatability htmlspecialchars_decode validation PHP4 regression
Focuses: Cc:

Description

There is a variable name mismatch in the WordPress version of the function htmlspecialchars_decode (introduced in PHP5.1). Parameter 1 is $str, but the validation tests $string, and thus the function will never execute, because $string is always null and fails the test.

This is a regression because it broke the AZIndex plugin (version 0.7.5) when the "ignore characters" option was set for an index. It will also break any code, plugin, or theme that uses this function when running on PHP < 5.1.

The line in error is line 104 in wp-includes/compat.php:

if ( !is_scalar( $string ) ) {

should be

if ( !is_scalar( $str ) ) {

Change History (6)

comment:1 @stringfold7 years ago

  • Keywords compatability htmlspecialchars_decode regression added; compat.php htmlspecialchars_decode. removed

comment:2 @ryan7 years ago

[10543] for trunk

comment:3 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

[10544] for 2.7

comment:4 @ryan7 years ago

(In [10543]) Use right variable name. Props stringfold. fixes #9090 for trunk

comment:5 @ryan7 years ago

(In [10544]) Use right variable name. Props stringfold. fixes #9090 for 2.7

comment:6 @ryan7 years ago

(In [10544]) Use right variable name. Props stringfold. fixes #9090 for 2.7

Note: See TracTickets for help on using tickets.