You are here

function _footnotes_filter_url_trim in Footnotes 6.2

Same name and namespace in other branches
  1. 5.2 footnotes.module \_footnotes_filter_url_trim()

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

4 calls to _footnotes_filter_url_trim()
_footnotes_filter_url in ./footnotes.module
URL filter. Automatically converts text web addresses (URLs, e-mail addresses, ftp links, etc.) into hyperlinks.
_footnotes_filter_url_parse_email_links in ./footnotes.module
Callback function. Make links out of e-mail addresses.
_footnotes_filter_url_parse_full_links in ./footnotes.module
Callback function. Make links out of absolute URLs.
_footnotes_filter_url_parse_partial_links in ./footnotes.module
Callback function. Make links out of domain names starting with "www.".

File

./footnotes.module, line 772
The Footnotes module is a filter that can be used to insert automatically numbered footnotes into Drupal texts.

Code

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