Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#35864 closed defect (bug) (fixed)

Calling wptexturize() with trailing less-than symbol causes PHP warning

Reported by: westonruter Owned by: ocean90
Priority: normal Milestone: 4.5
Component: Formatting Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Calling wptexturize( 'foo< ) causes a PHP warning:

Uninitialized string offset: 1

The issue lies in the _wptexturize_pushpop_element function which is not checking if an array item is set. It needs this change:

- if ( '/' !== $text[1] ) {
+ if ( isset( $text[1] ) && '/' !== $text[1] ) {

Discovered while testing #27355.

Attachments (1)

35864.0.diff​ (1.3 KB ) - added by westonruter 11 years ago.

Download all attachments as: .zip

Change History (3)

@westonruter
11 years ago

#1 @westonruter
11 years ago

  • Keywords has-patch added

#2 @ocean90
11 years ago

  • Owner set to ocean90
  • Resolution → fixed
  • Status new → closed

In 36578:

Formatting: Avoid a PHP warning when wptexturize() is called with a trailing less-than symbol.

Props westonruter.
Fixes #35864.

Note: See TracTickets for help on using tickets.