Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#9090 closed defect (bug) (fixed)

validation broken in htmlspecialchars_decode replacement function

Reported by: stringfold's profile 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)

#1 @stringfold
16 years ago

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

#2 @ryan
16 years ago

[10543] for trunk

#3 @ryan
16 years ago

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

[10544] for 2.7

#4 @ryan
16 years ago

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

#5 @ryan
16 years ago

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

#6 @ryan
16 years ago

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

Note: See TracTickets for help on using tickets.