You are here

function _filter_url_trim in Drupal 5

Same name and namespace in other branches
  1. 8 core/modules/filter/filter.module \_filter_url_trim()
  2. 6 modules/filter/filter.module \_filter_url_trim()
  3. 7 modules/filter/filter.module \_filter_url_trim()
  4. 9 core/modules/filter/filter.module \_filter_url_trim()
  5. 10 core/modules/filter/filter.module \_filter_url_trim()

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

3 calls to _filter_url_trim()
_filter_url in modules/filter/filter.module
URL filter. Automatically converts text web addresses (URLs, e-mail addresses, ftp links, etc.) into hyperlinks.
_filter_url_parse_full_links in modules/filter/filter.module
Make links out of absolute URLs.
_filter_url_parse_partial_links in modules/filter/filter.module
Make links out of domain names starting with "www."

File

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

Code

function _filter_url_trim($text, $length = NULL) {
  static $_length;
  if ($length !== NULL) {
    $_length = $length;
  }
  if (strlen($text) > $_length) {
    $text = substr($text, 0, $_length) . '...';
  }
  return $text;
}