function _eminline_url in Embedded Media Field 6.3
Same name and namespace in other branches
- 5 contrib/eminline/eminline.module \_eminline_url()
- 6 contrib/eminline/eminline.module \_eminline_url()
- 6.2 contrib/eminline/eminline.module \_eminline_url()
Match all http(s) URLs and pass to link checker.
Parameters
string $text: The contents of the text area.
int $format: The format id.
Return value
string
1 call to _eminline_url()
- eminline_filter in contrib/
eminline/ eminline.module - Implemenation of hook_filter().
File
- contrib/
eminline/ eminline.module, line 61
Code
function _eminline_url($text, $format) {
$text = ' ' . $text . ' ';
// Need to attach the variables to the callback after the regex.
$callback = _eminline_curry('_eminline_url_parse_full_links', 2);
// Match absolute URLs.
$text = preg_replace_callback("`(?<=[\\s(>])((http://|https://)([a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))(?=[.,?!\\s)<])`i", $callback($format), $text);
return $text;
}