Skip to content

Commit 39fc1ff

Browse files
committed
examples/web_file_browser: Fix URL/href escaping.
Wasn't URL-encoding the URL. (Still need to HTML escape it after that.)
1 parent 816f3f2 commit 39fc1ff

File tree

1 file changed

+2
-1
lines changed
  • examples/web-file-browser/src/com/dropbox/core/examples/web_file_browser

1 file changed

+2
-1
lines changed

examples/web-file-browser/src/com/dropbox/core/examples/web_file_browser/DropboxBrowse.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ else if (listing.entry instanceof DbxEntry.Folder) {
114114
// Listing of folder contents.
115115
out.println("<ul>");
116116
for (DbxEntry child : listing.children) {
117-
out.println(" <li><a href='/browse?path=" + escapeHtml4(child.path) + "'>" + escapeHtml4(child.name) + "</a></li>");
117+
String href = "/browse?path=" + DbxRequestUtil.encodeUrlParam(child.path);
118+
out.println(" <li><a href='" + escapeHtml4(href) + "'>" + escapeHtml4(child.name) + "</a></li>");
118119
}
119120
out.println("</ul>");
120121
}

0 commit comments

Comments
 (0)