Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 7 years ago

#12118 closed defect (bug) (fixed)

wp_texturize converting x to × is too greedy

Reported by: mtdewvirus's profile mtdewvirus Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Formatting Keywords: needs-unit-tests
Focuses: Cc:


Converting x to × in wp_texturize() converts too much. Strings like 4x4 and 4x20=80 should be converted but there are a lot of times when x is in a model number such as rt2x00 where the character should not be converted to a multiplication symbol.

Change History (4)

#1 @dd32
14 years ago

  • Keywords needs-unit-tests added

A quick method for this, would be to have the regex matching word boundaries: /\b(\d+)x(\d+)\b/ and that seems to work as expected:


"4x4 and 4x20=80 ....2x2, but not A4x4 and  rt2x00";
string '4×4 and 4×20=80 ….2×2, but not A4x4 and  rt2x00'

#2 @dd32
14 years ago

(In [14144]) Make (\d)x(\d) texturization less greedy, requires a word boundary either side of the phrase. See #12118

#3 @technosailor
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Since there's a fix in, it seems this ticket never got closed. So closing.

Note: See TracTickets for help on using tickets.