You are here

function _eminline_url in Embedded Media Field 5

Same name and namespace in other branches
  1. 6.3 contrib/eminline/eminline.module \_eminline_url()
  2. 6 contrib/eminline/eminline.module \_eminline_url()
  3. 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("`(<p>|<li>|<br\\s*/?>|[ \n\r\t\\(])((http://|https://)([a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))([.,?!]*?)(?=(</p>|</li>|<br\\s*/?>|[ \n\r\t\\)]))`i", $callback($format), $text);
  return $text;
}