diff options
author | anekos | 2011-01-22 01:03:12 +0900 |
---|---|---|
committer | anekos | 2011-01-22 01:03:41 +0900 |
commit | 3409d830086e9d9ca0dcea57cd77dcede0b0f834 (patch) | |
tree | fca9787158e2027c113bbab482fb8f0e5f3fd7f1 /pluginManager.js | |
parent | 98c86cbdf783923b6a8e0cdd5a8736cee58425d3 (diff) | |
download | vimperator-plugins-3409d830086e9d9ca0dcea57cd77dcede0b0f834.tar.bz2 |
Important security fix
Diffstat (limited to 'pluginManager.js')
-rw-r--r-- | pluginManager.js | 17 |
1 files changed, 14 insertions, 3 deletions
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 = <description>Manage Vimperator Plugins</description> <description lang="ja">Vimpeatorプラグインの管理</description> <author mail="teramako@gmail.com" homepage="http://d.hatena.ne.jp/teramako/">teramako</author> -<version>0.6.6</version> +<version>0.6.7</version> <minVersion>2.3</minVersion> <maxVersion>2.4</maxVersion> <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/pluginManager.js</updateURL> @@ -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, '<a href="' + href + '" highlight="URL">$&</a>')); + 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)}<a href={withLink ? m[0] : '#'} highlight="URL">{m[0]}</a></>; + 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){ |