WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#6739 closed defect (bug) (wontfix)

smilie regular expression issue

Reported by: hailin Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

There is an issue with $wp_smiliessearch, it will miss some valid smilies.
For example, for :) the pattern is:
/(\s|)\:\)(\s|$)/

If the input is ":) :) :) :)"
It will produce only two smilies.

The fix is to change the pattern to:
/(\s*|)\:\)(\s|$)/

Attachments (2)

6739_smilie_pattern.diff (755 bytes) - added by hailin 7 years ago.
patch
8comments.png (11.9 KB) - added by aholm 6 years ago.

Download all attachments as: .zip

Change History (6)

@hailin7 years ago

patch

comment:1 @jacobsantos7 years ago

  • Summary changed from smilie regular experssion issue to smilie regular expression issue

comment:2 @markjaquith7 years ago

  • Milestone changed from 2.7 to 2.8

What are some of the potential downsides to a more liberal expression? Can you think of any cases where we'd accidentally make a smiley where there shouldn't be one?

@aholm6 years ago

comment:3 @aholm6 years ago

There are some issues with making it more liberal. There are even some issues right now as can be seen in some themes, like the one Matt uses. See attached screenshot for how it looks when a post has 8 comments which the theme shows as (8) which is replaced with (<img src="icon-cool.gif"> or so, which is then parsed as the appropriate markup.

comment:4 @thee176 years ago

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

I'm closing as won't fix as this has big downsides, and has lost traction. Reopen if you disagree.

Note: See TracTickets for help on using tickets.