[wp-trac] [WordPress Trac] #24556: wptexturize() edge case bug with specific sentence structure

WordPress Trac noreply at wordpress.org
Mon Jun 10 22:15:29 UTC 2013


#24556: wptexturize() edge case bug with specific sentence structure
--------------------------+-----------------------------
 Reporter:  jkudish       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 I discovered a very very edge case bug with `wptexturize()` where the
 below text will be output with the opening quote as the closing quote html
 entity (e.g. `”`) instead of the opening quote html entity (e.g.
 `“`) as expected.

 Here's the text. The words can be replaced with anything else as long as
 they follow the same pattern.

 {{{
 Uppercase. ”Uppercase lowercase word-with-apostrophe’s lowercase
 lowercase”
 }}}

 Here's how it gets output on the front-end:

 [[Image(https://dl.dropbox.com/s/zbrilmyoo8awkjo/2013-06-10%20at%203.08.39%20PM.png)]]

 The exact same problem happens regardless of the theme used. I can also
 consistently reproduce on WordPress 3.5.1 as well as with trunk. No
 plugins installed.

 I've tracked the bug down to the,
 [http://core.trac.wordpress.org/browser/trunk/wp-
 includes/formatting.php#L89 opening quote regex] in `wp_texturize()`.

 My regex foo isn't good enough to figure out a proper solution here
 unfortunately.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24556>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list