_filter_url_parse_partial_links

_filter_url_parse_partial_links($match)

Makes links out of domain names starting with "www."

Callback for preg_replace_callback() within _filter_url().

Related topics

Standard filters
Filters implemented by the Filter module.

File

core/modules/filter/filter.module, line 622
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] = Html::decodeEntities($match[$i]);
  $caption = Html::escape(_filter_url_trim($match[$i]));
  $match[$i] = Html::escape($match[$i]);
  return '<a href="http://' . $match[$i] . '">' . $caption . '</a>';
}
doc_Drupal
2016-10-29 09:57:14
Comments
Leave a Comment

Please login to continue.