_filter_url_trim

5 filter.module _filter_url_trim($text, $length = NULL)
6 filter.module _filter_url_trim($text, $length = NULL)
7 filter.module _filter_url_trim($text, $length = NULL)
8 filter.module _filter_url_trim($text, $length = NULL)

Shortens long URLs to http://www.example.com/long/url...

Related topics

4 calls to _filter_url_trim()

File

modules/filter/filter.module, line 1570
Framework for handling filtering of content.

Code

function _filter_url_trim($text, $length = NULL) {
  static $_length;
  if ($length !== NULL) {
    $_length = $length;
  }

  // Use +3 for '...' string length.
  if ($_length && strlen($text) > $_length + 3) {
    $text = substr($text, 0, $_length) . '...';
  }

  return $text;
}
Login or register to post comments