From 3409d830086e9d9ca0dcea57cd77dcede0b0f834 Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 22 Jan 2011 01:03:12 +0900 Subject: Important security fix --- pluginManager.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'pluginManager.js') diff --git a/pluginManager.js b/pluginManager.js index 8e520ec..f28590a 100644 --- a/pluginManager.js +++ b/pluginManager.js @@ -4,7 +4,7 @@ var PLUGIN_INFO = Manage Vimperator Plugins Vimpeatorプラグインの管理 teramako -0.6.6 +0.6.7 2.3 2.4 https://github.com/vimpr/vimperator-plugins/raw/master/pluginManager.js @@ -190,8 +190,19 @@ for (let it in Iterator(tags)){ }; } function makeLink(str, withLink){ - var href = withLink ? '$&' : '#'; - return XMLList(str.replace(/(?:https?:\/\/|mailto:)\S+/g, '$&')); + let s = str; + let result = XMLList(); + while (s.length > 0) { + let m = s.match(/(?:https?:\/\/|mailto:)\S+/); + if (m) { + result += <>{s.slice(0, m.index)}{m[0]}; + s = s.slice(m.index + m[0].length); + } else { + result += <>{s}; + break; + } + } + return result; } function fromUTF8Octets(octets){ return decodeURIComponent(octets.replace(/[%\x80-\xFF]/g, function(c){ -- cgit v1.2.3