Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#9088 closed defect (bug) (fixed)

string replacement changed to incorrect regex replacement

Reported by: pne's profile pne Owned by:
Milestone: 2.7.2 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch commit
Focuses: Cc:


I saw that from 2.7 (r10049) to 2.7.1 (r10482), wp-admin/link-manager.php changed by turning

str_replace('www.', '', $short_url)


preg_replace('/^www./i', '', $short_url)

I think that the regex should be


with a backslash before the dot, since dot is special in regexes ('match any character'), which is probably not what is intended here.

Attachments (1)

9088.diff (623 bytes) - added by sivel 15 years ago.

Download all attachments as: .zip

Change History (4)

15 years ago

#1 @sivel
15 years ago

  • Cc matt@… added
  • Keywords has-patch commit added; regex removed

#2 @automattor
15 years ago

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

(In [10717]) Escape dot in regex. Props pne, sivel. fixes #9088 for trunk

#3 @ryan
15 years ago

(In [10718]) Escape dot in regex. Props pne, sivel. fixes #9088 for 2.7

Note: See TracTickets for help on using tickets.