roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r469305 - /incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
Date Mon, 30 Oct 2006 22:30:09 GMT
Author: agilliland
Date: Mon Oct 30 14:30:09 2006
New Revision: 469305

URL: http://svn.apache.org/viewvc?view=rev&rev=469305
Log:
fixing a bug which was blocking uploads into subfolders.


Modified:
    incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java

Modified: incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java?view=diff&rev=469305&r1=469304&r2=469305
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
Mon Oct 30 14:30:09 2006
@@ -235,10 +235,6 @@
                         // disallow sneaky null terminated strings
                         fileName = fileName.substring(0, terminated).trim();
                     }
-                    if(theForm.getPath() != null && 
-                            theForm.getPath().trim().length() > 0) {
-                        fileName = theForm.getPath() + "/" + fileName;
-                    }
                     
                     // make sure fileName is valid
                     if (fileName.indexOf("/") != -1 || 
@@ -248,6 +244,13 @@
                                 new ActionError("uploadFiles.error.badPath", fileName));
                         continue;
                     }
+                    
+                    // add on the path element if needed
+                    if(theForm.getPath() != null && 
+                            theForm.getPath().trim().length() > 0) {
+                        fileName = theForm.getPath() + "/" + fileName;
+                    }
+                    
                     
                     try {
                         fmgr.saveFile(website, fileName,



Mime
View raw message