Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[webdoc] escape <> in fastsearch box URLs by replacing them with {}
Browse files Browse the repository at this point in the history
  • Loading branch information
garuma committed Jan 30, 2012
1 parent ba25c88 commit f216941
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webdoc/search.js
Expand Up @@ -58,7 +58,8 @@ search_input.keyup (function (event) {

$.each (data, function(key, val) {
var item = val.name;
items.push('<li><a href="#" onclick="change_page(\''+val.url+'\')" title="'+(val.fulltitle == '' ? val.name : val.fulltitle)+'">' + item + '</a></li>');
var url = val.url.replace (/[<>]/g, function (c) { return c == '<' ? '{' : '}'; });
items.push('<li><a href="#" onclick="change_page(\''+url+'\')" title="'+(val.fulltitle == '' ? val.name : val.fulltitle)+'">' + item + '</a></li>');
});

var uls = $('<ul/>', { html: items.join (''), 'style': 'list-style-type:none; margin: 0; padding:0' });
Expand Down

0 comments on commit f216941

Please sign in to comment.