From a0506593725a81065f13b94c7a94ba4e73660479 Mon Sep 17 00:00:00 2001 From: sostler Date: Thu, 27 May 2010 14:42:14 -0400 Subject: Checking for http:// in links is case-insensitive --- static/js/pichat.js | 5 ++--- 1 file 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; -- cgit v1.2.3-70-g09d2