roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r778209 - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/business/FileManagerImpl.java src/java/org/apache/roller/weblogger/ui/struts2/editor/Resources.java web/WEB-INF/classes/ApplicationResources.properties
Date Sun, 24 May 2009 18:42:11 GMT
Author: snoopdave
Date: Sun May 24 18:42:10 2009
New Revision: 778209

URL: http://svn.apache.org/viewvc?rev=778209&view=rev
Log:
Fix for ROL-1802, null pointer exception uploading files:
    https://issues.apache.org/jira/browse/ROL-1802

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Resources.java
    roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileManagerImpl.java?rev=778209&r1=778208&r2=778209&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileManagerImpl.java
Sun May 24 18:42:10 2009
@@ -399,11 +399,11 @@
         }
         
         // fifth check, is save path viable?
-        if(path.indexOf("/") != -1) {
+        if (path.indexOf("/") != -1) {
             // just make sure there is only 1 directory, we don't allow multi
             // level directory hierarchies right now
-            if(path.lastIndexOf("/") != path.indexOf("/")) {
-                errors.addError("error.upload.badPath");
+            if (path.lastIndexOf("/") != path.indexOf("/")) {
+                errors.addError("error.upload.badPath", path);
                 return false;
             }
         }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Resources.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Resources.java?rev=778209&r1=778208&r2=778209&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Resources.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Resources.java
Sun May 24 18:42:10 2009
@@ -252,7 +252,11 @@
         
         for (Iterator it = errors.getErrors(); it.hasNext();) {
             RollerMessage msg = (RollerMessage)it.next();
-            addError(msg.getKey(), Arrays.asList(msg.getArgs()));
+            if (msg.getArgs() != null) {
+               addError(msg.getKey(), Arrays.asList(msg.getArgs()));
+            } else {
+               addError(msg.getKey());
+            }
         }
 
         if(uploaded.size() > 0) {

Modified: roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties?rev=778209&r1=778208&r2=778209&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties Sun May
24 18:42:10 2009
@@ -514,6 +514,7 @@
 error.upload.file=No file selected
 error.upload.filemax=File larger than maximum allowed: {0} MB
 error.upload.forbiddenFile=You can only upload files with these extensions and content-types:
{0}
+error.upload.badPath=Bad path: file-upload only supports one level of subdirectory
 
 error.general=ERROR: Unexpected Exception [{0}] has been logged.
 



Mime
View raw message