function _filter_url_parse_partial_links in Drupal 7
Same name and namespace in other branches
- 8 core/modules/filter/filter.module \_filter_url_parse_partial_links()
- 5 modules/filter/filter.module \_filter_url_parse_partial_links()
- 6 modules/filter/filter.module \_filter_url_parse_partial_links()
- 9 core/modules/filter/filter.module \_filter_url_parse_partial_links()
- 10 core/modules/filter/filter.module \_filter_url_parse_partial_links()
Makes links out of domain names starting with "www."
Callback for preg_replace_callback() within _filter_url().
Related topics
File
- modules/
filter/ filter.module, line 1604 - Framework for handling the filtering of content.
Code
function _filter_url_parse_partial_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="http://' . $match[$i] . '">' . $caption . '</a>' . $match[$i + 1];
}