diff options
author | Gina Dimino <gdimino@google.com> | 2016-01-05 15:00:36 -0800 |
---|---|---|
committer | Gina Dimino <gdimino@google.com> | 2016-01-05 15:08:40 -0800 |
commit | bbde9363fad585d00676160cc3057804c5acf919 (patch) | |
tree | 6a0f597edcff9c2567214e8489a610f8d210d76a | |
parent | 0e80edd259d1ce7f35d8c9841f88296416c1e2cf (diff) | |
download | build-bbde9363fad585d00676160cc3057804c5acf919.tar.gz |
Docs: Encode URL input to search box
Bug: 26287939
Change-Id: Ica656034412b517e182333f5fe4f6e9bc5f300f3
-rw-r--r-- | tools/droiddoc/templates-sac/assets/js/docs.js | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tools/droiddoc/templates-sac/assets/js/docs.js b/tools/droiddoc/templates-sac/assets/js/docs.js index 195c9e5f06..d0c12a8787 100644 --- a/tools/droiddoc/templates-sac/assets/js/docs.js +++ b/tools/droiddoc/templates-sac/assets/js/docs.js @@ -2015,10 +2015,7 @@ $(window).hashchange( function(){ }); function updateResultTitle(query) { - $("#searchTitle").html("Results for <em>" + (query) + "</em>"); -// For some reason, the escapeHTML function wasn't working for me. TODO fix -// this by copying in a comparable library function. -// $("#searchTitle").html("Results for <em>" + escapeHTML(query) + "</em>"); + $("#searchTitle").html("Results for <em>" + encodeURIComponent(query) + "</em>"); } // forcefully regain key-up event control (previously jacked by search api) @@ -2055,13 +2052,6 @@ function getQuery(hash) { return queryParts[1]; } -/* returns the given string with all HTML brackets converted to entities - TODO: move this to the site's JS library */ -function escapeHTML(string) { - return string.replace(/</g,"<") - .replace(/>/g,">"); -} - /* ######################################################## */ /* ################# JAVADOC REFERENCE ################### */ |