Is this necessary?
On Sunday 10 June 2007 21:01, you wrote: > Author: zothar > Date: 2007-06-10 20:01:10 +0000 (Sun, 10 Jun 2007) > New Revision: 13509 > > Modified: > trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java > trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties > Log: > Use URL encoding in BookmarkEditorToadlet > > Modified: trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java > =================================================================== > --- > trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java > 2007-06-0 >9 21:38:28 UTC (rev 13508) +++ > trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java > 2007-06-1 >0 20:01:10 UTC (rev 13509) @@ -16,6 +16,9 @@ > import freenet.node.NodeClientCore; > import freenet.client.HighLevelSimpleClient; > import freenet.support.HTMLNode; > +import freenet.support.URLDecoder; > +import freenet.support.URLEncodedFormatException; > +import freenet.support.URLEncoder; > import freenet.support.api.HTTPRequest; > > public class BookmarkEditorToadlet extends Toadlet { > @@ -53,8 +56,8 @@ > > for(int i = 0; i < items.size(); i++) { > > - String itemPath = path + items.get(i).getName(); > - HTMLNode li = new HTMLNode("li", "class","item" , > items.get(i).getName()); + String itemPath = > URLEncoder.encode(path + > items.get(i).getName()); + HTMLNode li = new > HTMLNode("li", "class", > "item" , items.get(i).getName()); > > HTMLNode actions = new HTMLNode("span", "class", > "actions"); > actions.addChild("a", "href", "?action=edit&bookmark=" + > itemPath).addChild("img", new String[] {"src", "alt", "title"}, new > String[] {"/static/icon/edit.png", edit, edit}); @@ -77,7 +80,7 @@ > BookmarkCategories cats = cat.getSubCategories(); > for(int i = 0; i < cats.size(); i++) { > > - String catPath = path + cats.get(i).getName() + "/"; > + String catPath = URLEncoder.encode(path + > cats.get(i).getName() + "/"); > > HTMLNode subCat = list.addChild("li", "class", "cat", > cats.get(i).getName()); > > @@ -141,7 +144,15 @@ > > if (req.getParam("action").length() > 0 && > req.getParam("bookmark").length() > 0) { String action = > req.getParam("action"); > - String bookmarkPath = req.getParam("bookmark"); > + String bookmarkPath; > + try { > + bookmarkPath = > URLDecoder.decode(req.getParam("bookmark"), false); > + } catch (URLEncodedFormatException e) { > + HTMLNode errorBox = > content.addChild(ctx.getPageMaker().getInfobox("infobox-error", error)); > + errorBox.addChild("#", > L10n.getString("BookmarkEditorToadlet.urlDecodeError")); > + this.writeReply(ctx, 200, "text/html", "OK", > pageNode.generate()); > + return; > + } > Bookmark bookmark; > > if (bookmarkPath.endsWith("/")) > > Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties > =================================================================== > --- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-06-09 > 21:38:28 UTC (rev 13508) +++ > trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-06-10 > 20:01:10 UTC (rev 13509) @@ -34,6 +34,7 @@ > BookmarkEditorToadlet.pasteTitle=Cut/Paste > BookmarkEditorToadlet.save=Save > BookmarkEditorToadlet.title=Bookmark Editor > +BookmarkEditorToadlet.urlDecodeError=URL Decode Error > BookmarkItem.bookmarkUpdated=The bookmarked site ${name} has been updated > to edition ${edition}. BookmarkItem.bookmarkUpdatedTitle=Bookmark Updated: > ${name} > BookmarkItem.bookmarkUpdatedWithLink=The bookmarked site > ${link}${name}${/link} has been updated to edition ${edition}. > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20070611/b7a72c5d/attachment.pgp>