You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2006/10/30 23:30:09 UTC
svn commit: r469305 -
/incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
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,