diff options
| author | sostler <sbostler@gmail.com> | 2010-05-27 14:42:14 -0400 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-05-27 14:42:14 -0400 |
| commit | a0506593725a81065f13b94c7a94ba4e73660479 (patch) | |
| tree | ed5e582d0dfacb2757c5705bc8e638868aebbbd2 | |
| parent | 96adff534b34ca1e92f12266e27a9784ec802f40 (diff) | |
Checking for http:// in links is case-insensitive
| -rw-r--r-- | static/js/pichat.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index e2ab061..93e2f05 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -74,9 +74,8 @@ function linkify(text) { // durty hack to use a global to check this... but otherwise i'd have to rewrite the String.replace function? :/ var LastMsgContainsImage = false function linkReplace(url) { - //var urlWithoutParams = url.replace(/\?.*$/i, ""); - - if (url.indexOf('http://') == 0 || url.indexOf('https://') == 0 || url.indexOf('ftp://') == 0) + var lowerurl = url.toLowerCase(); + if (lowerurl.indexOf('http://') == 0 || lowerurl.indexOf('https://') == 0 || lowerurl.indexOf('ftp://') == 0) linkUrl = url; else linkUrl = 'http://' + url; |
