Author: nextgens
Date: 2007-11-30 19:17:05 +0000 (Fri, 30 Nov 2007)
New Revision: 16147

Modified:
   trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
Log:
BookmarkManager: don't trim() at the wrong place!

Modified: trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java   
2007-11-30 19:15:18 UTC (rev 16146)
+++ trunk/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java   
2007-11-30 19:17:05 UTC (rev 16147)
@@ -52,7 +52,7 @@

                for(int i = 0; i < items.size(); i++) {

-                       String itemPath = URLEncoder.encode(path + 
items.get(i).getName(), false);
+                       String itemPath = URLEncoder.encode(path + 
items.get(i).getName(), false).trim();
                        HTMLNode li = new HTMLNode("li", "class", "item", 
items.get(i).getName());

                        HTMLNode actions = new HTMLNode("span", "class", 
"actions");
@@ -286,7 +286,7 @@
                        }


-                       String action = req.getPartAsString("action", 
MAX_ACTION_LENGTH);
+                       String action = req.getPartAsString("action", 
MAX_ACTION_LENGTH).trim();

                        if(req.isPartSet("confirmdelete")) {
                                bookmarkManager.removeBookmark(bookmarkPath);

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java        
2007-11-30 19:15:18 UTC (rev 16146)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java        
2007-11-30 19:17:05 UTC (rev 16147)
@@ -192,7 +192,7 @@
        }

        public BookmarkCategory getCategoryByPath(String path) {
-               Bookmark cat = getBookmarkByPath(path.trim());
+               Bookmark cat = getBookmarkByPath(path);
                if(cat instanceof BookmarkCategory)
                        return (BookmarkCategory) cat;

@@ -200,7 +200,7 @@
        }

        public BookmarkItem getItemByPath(String path) {
-               if(getBookmarkByPath(path.trim()) instanceof BookmarkItem)
+               if(getBookmarkByPath(path) instanceof BookmarkItem)
                        return (BookmarkItem) getBookmarkByPath(path);

                return null;


Reply via email to