Author: toad
Date: 2007-04-14 15:46:07 +0000 (Sat, 14 Apr 2007)
New Revision: 12691

Modified:
   trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
Log:
Refuse to add noderef if it ends with something other than End

Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2007-04-14 15:34:45 UTC (rev 12690)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2007-04-14 15:46:07 UTC (rev 12691)
@@ -711,6 +711,9 @@

                        try {
                                fs = new SimpleFieldSet(ref.toString(), false, 
true);
+                               if(!fs.getEndMarker().endsWith("End")) {
+                                       sendErrorPage(ctx, 200, "Failed to Add 
Node", "Unable to parse the node reference: It should end with End on a line by 
itself, but it ends with "+fs.getEndMarker());
+                               }
                                fs.setEndMarker("End"); // It's always End ; 
the regex above doesn't always grok this
                        } catch (IOException e) {
                                this.sendErrorPage(ctx, 200, "Failed To Add 
Node", "Unable to parse the given text as a node reference ("+e+"). Please try 
again.");


Reply via email to