summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-12 16:43:31 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-13 09:07:51 (GMT)
commitaa63f121c855484da75bab9de64c16388f653384 (patch)
tree29092ba8fb6586db0316855e7edb9c494868bbb8 /plugins/libcalendaring
parent8e80c9a485f6ca481cdf13f9d76f273ba713ae18 (diff)
downloadroundcubemail-plugins-kolab-aa63f121c855484da75bab9de64c16388f653384.tar.gz
Fix link regex and replacement
Diffstat (limited to 'plugins/libcalendaring')
-rw-r--r--plugins/libcalendaring/libcalendaring.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/libcalendaring/libcalendaring.js b/plugins/libcalendaring/libcalendaring.js
index ce09755..6f20ab7 100644
--- a/plugins/libcalendaring/libcalendaring.js
+++ b/plugins/libcalendaring/libcalendaring.js
@@ -303,11 +303,11 @@ function rcube_libcalendaring(settings)
// simple link parser (similar to rcube_string_replacer class in PHP)
var utf_domain = '[^?&@"\'/\\(\\)\\s\\r\\t\\n]+\\.([^\x00-\x2f\x3b-\x40\x5b-\x60\x7b-\x7f]{2,}|xn--[a-z0-9]{2,})';
var url1 = '.:;,', url2 = 'a-z0-9%=#@+?&/_~\\[\\]-';
- var link_pattern = new RegExp('([hf]t+ps?://)('+utf_domain+'(['+url1+']?['+url2+']+)*)?', 'ig');
+ var link_pattern = new RegExp('([hf]t+ps?://)('+utf_domain+'(['+url1+']?['+url2+']+)*)', 'ig');
var mailto_pattern = new RegExp('([^\\s\\n\\(\\);]+@'+utf_domain+')', 'ig');
var link_replace = function(matches, p1, p2) {
var title = '', text = p2;
- if (p2.length > 55) {
+ if (p2 && p2.length > 55) {
text = p2.substr(0, 45) + '...' + p2.substr(-8);
title = p1 + p2;
}