[wp-trac] [WordPress Trac] #32380: WPTexturize doesn't handle locale switching properly

WordPress Trac noreply at wordpress.org
Wed May 13 18:54:24 UTC 2015


#32380: WPTexturize doesn't handle locale switching properly
--------------------------+-----------------------------
 Reporter:  ivanblagdan   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  4.2.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Had some issues with wptexturize() not applying french style quotes on a
 locale which had them defined via a .po file. The locale was defined in
 the options for the site on a multisite install.
 The issue was tracked down to a plugin firing get_plugin_data(), which in
 turn fires wptexturize() when parsing out the description from the plugin
 header comment block. Since wptexturize() stores replacements in the
 static space and expects them to be populated on the first run, these get
 baked in with when _x() fired with the default locale. This is the case
 with most static replacements there, we had a problem with the quotes.
 I'm attaching a patch that gives wptexturize a chance to reset itself if
 the locale changed.
 There's also a test in the patch, which simulates the locale change
 behaviour since otherwise it would require some actual .po localization
 files to test this.

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


More information about the wp-trac mailing list