Opened 7 years ago
Closed 7 years ago
#28222 closed defect (bug) (fixed)
wp_extract_urls recognize a date as a url
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.7 |
Component: | Pings/Trackbacks | Keywords: | has-patch |
Focuses: | Cc: |
Description
wp_extract_urls("Today's Date: 05.12.2014")
has the following array as output
Array ( [0] => 05.12.2014 )
A date is not an IP address.
Attachments (3)
Change History (15)
#5
@
7 years ago
- Keywords needs-unit-tests removed
The function still will not extract "http://localhost/" as a "." is mandatory.
#WCHH14
#7
@
7 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 28882:
#8
follow-up:
↓ 9
@
7 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
In r28882 since you're doing concatenation in PHP, you don't really need the x
preg pattern modifier.
#10
@
7 years ago
I've added the /x modifier for better readability, only. I prefer doing this in longer regular expressions.
All whitespaces in the pattern are totally ignored (see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php).
If you don't like, I will strip it.
#11
in reply to:
↑ 9
@
7 years ago
Replying to SergeyBiryukov:
I don't think they're necessary though.
You're right, I missed those. I agree re necessity, I spotted 6 of them. The x modifier would be more useful if the regex was indeed a single string. So either concatenate with PHP and remove whitespace and the x modifier, or keep the x modifier and remove PHP newline concatenation, but not both.
Introduced in [25313].