#9088 closed defect (bug) (fixed)
string replacement changed to incorrect regex replacement
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7.2 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | matt@… |
Description
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)
into
preg_replace('/^www./i', '', $short_url)
I think that the regex should be
/^www\./i
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)
Change History (4)
comment:2
automattor
— 4 years ago
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
(In [10717]) Escape dot in regex. Props pne, sivel. fixes #9088 for trunk