[wp-trac] [WordPress Trac] #35864: Calling wptexturize() with trailing less-than symbol causes PHP warning

WordPress Trac noreply at wordpress.org
Thu Feb 18 19:42:16 UTC 2016


#35864: Calling wptexturize() with trailing less-than symbol causes PHP warning
--------------------------+-----------------
 Reporter:  westonruter   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.5
Component:  Formatting    |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------
 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:

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

 Discovered while testing #27355.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35864>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list