Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#35864 closed defect (bug) (fixed)

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

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


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 8 years ago.

Download all attachments as: .zip

Change History (3)

8 years ago

#1 @westonruter
8 years ago

  • Keywords has-patch added

#2 @ocean90
8 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to 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.