Opened 14 years ago
Last modified 14 months ago
#22330 new enhancement
Optimize regexes to remove protocol from URL
| Reported by: | GeertDD | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Formatting | Version: | 3.4.2 |
| Severity: | normal | Keywords: | has-patch needs-unit-tests needs-testing |
| Cc: | Focuses: |
Description
Regexes used to chop off the protocol of a URL should be anchored to the start of the string.
- The regex fails faster and thus avoid useless work. No need to look further down the URL for strings like
"http://". - The regex should not alter any URLs that might be contained in the query string.
Attachments (2)
Change History (6)
#1
@
13 years ago
- Component General → Formatting
- Keywords needs-unit-tests needs-refresh added
- Milestone Awaiting Review → Future Release
This ticket was mentioned in PR #9208 on WordPress/wordpress-develop by @sainathpoojary.
14 months ago
#4
- Keywords needs-refresh removed
Trac ticket: #22330
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I think 22330.2.diff is a full refresh of the remaining instances here. We do need to make sure that these don't break anything, though. (They look good at a glance.) In some cases these are unit-testable, as well.