You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/07/25 22:42:23 UTC

svn commit: r425519 - in /incubator/roller/branches/roller_2.4_appd9: src/org/apache/roller/business/FileManagerImpl.java src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java web/WEB-INF/classes/ApplicationResources.properties

Author: snoopdave
Date: Tue Jul 25 13:42:22 2006
New Revision: 425519

URL: http://svn.apache.org/viewvc?rev=425519&view=rev
Log:
Fix in content-type upload logic and message

Modified:
    incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/business/FileManagerImpl.java
    incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
    incubator/roller/branches/roller_2.4_appd9/web/WEB-INF/classes/ApplicationResources.properties

Modified: incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/business/FileManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/business/FileManagerImpl.java?rev=425519&r1=425518&r2=425519&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/business/FileManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/business/FileManagerImpl.java Tue Jul 25 13:42:22 2006
@@ -323,8 +323,8 @@
         if (forbidFiles != null && forbidFiles.length > 0) {
             for (int x=0; x<forbidFiles.length; x++) {
                 // oops, this forbid rule is NOT a content-type, skip it
-                if (allowFiles[x].indexOf("/") == -1) continue;               
-                if (matchContentType(allowFiles[x], contentType)) {
+                if (forbidFiles[x].indexOf("/") == -1) continue;               
+                if (matchContentType(forbidFiles[x], contentType)) {
                     allowFile = false;
                     break;
                 }

Modified: incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java?rev=425519&r1=425518&r2=425519&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java (original)
+++ incubator/roller/branches/roller_2.4_appd9/src/org/apache/roller/ui/authoring/struts/actions/UploadFileFormAction.java Tue Jul 25 13:42:22 2006
@@ -154,10 +154,10 @@
 
                         //retrieve the file data
                         if (fmgr.canSave(website.getHandle(), fileName, 
-                                request.getContentType(), fileSize, rollerMessages)) {
+                                files[i].getContentType(), fileSize, rollerMessages)) {
                             InputStream stream = files[i].getInputStream();
                             fmgr.saveFile(website.getHandle(), fileName, 
-                                request.getContentType(), fileSize, stream);
+                                files[i].getContentType(), fileSize, stream);
                             lastUploads.add(fileName);
                         }
                         

Modified: incubator/roller/branches/roller_2.4_appd9/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_2.4_appd9/web/WEB-INF/classes/ApplicationResources.properties?rev=425519&r1=425518&r2=425519&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.4_appd9/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ incubator/roller/branches/roller_2.4_appd9/web/WEB-INF/classes/ApplicationResources.properties Tue Jul 25 13:42:22 2006
@@ -418,7 +418,7 @@
 error.upload.disabled=File Upload has been turned off
 error.upload.file=No file selected
 error.upload.filemax=File larger than maximum allowed: {0} MB
-error.upload.forbiddenFile=You can only upload files ending in {0}
+error.upload.forbiddenFile=You can only upload files with these extensions and content-types: {0}
 
 error.general=ERROR: Unexpected Exception [{0}] has been logged.