--- htmlmail1.1.module 2008-12-20 12:00:26.000000000 -0600
+++ htmlmail.module 2008-12-20 12:11:30.000000000 -0600
@@ -105,6 +105,14 @@ function htmlmail_settings() {
'#default_value' => variable_get('htmlmail_urlfilter', '1'),
'#description' => t('Automatically converts text web addresses (URLs, e-mail addresses, ftp links, etc.) into hyperlinks.'),
);
+
+ $form['htmlmail_settings']['htmlmail_urllength'] = array(
+ '#type' => 'textfield',
+ '#title' => t('URL Trim Length'),
+ '#default_value' => variable_get('htmlmail_urllength', '72'),
+ '#size' => 3,
+ '#description' => t('Trim URL displays to this length. This does not affect the href attribute. Enter "0" to disable trimming.'),
+ );
return system_settings_form($form);
}
@@ -172,7 +180,7 @@ function htmlmail_admin_test_form_submit
*/
function _htmlmail_url($text) {
// Pass length to regexp callback
- _htmlmail_url_trim(NULL, 72);
+ _htmlmail_url_trim(NULL, variable_get('htmlmail_urllength', 72));
$text = ' '. $text .' ';
@@ -218,7 +226,7 @@ function _htmlmail_url_trim($text, $leng
$_length = $length;
}
- if (strlen($text) > $_length) {
+ if ($_length != 0 && strlen($text) > $_length) {
$text = substr($text, 0, $_length) .'...';
}