function _filter_url_parse_full_links

Same name and namespace in other branches
  1. 9 core/modules/filter/filter.module \_filter_url_parse_full_links()
  2. 8.9.x core/modules/filter/filter.module \_filter_url_parse_full_links()
  3. 10 core/modules/filter/filter.module \_filter_url_parse_full_links()
  4. 11.x core/modules/filter/filter.module \_filter_url_parse_full_links()

Makes links out of absolute URLs.

Callback for preg_replace_callback() within _filter_url().

Related topics

File

modules/filter/filter.module, line 1576

Code

function _filter_url_parse_full_links($match) {
    // The $i:th parenthesis in the regexp contains the URL.
    $i = 1;
    $match[$i] = decode_entities($match[$i]);
    $caption = check_plain(_filter_url_trim($match[$i]));
    $match[$i] = check_plain($match[$i]);
    return '<a href="' . $match[$i] . '">' . $caption . '</a>' . $match[$i + 1];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.