Changeset 1656

Show
Ignore:
Timestamp:
2008-02-28 16:28:12 (6 months ago)
Author:
th-schwarz
Message:

cleanup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java

    r1647 r1656  
    113113                XmlResponse xr; 
    114114                 
    115                 if (!SessionDataHandler.isEnabledForFileBrowsing(request)) 
     115                if (!CommandHandler.isValidForGet(commandStr)) 
     116                        xr = new XmlResponse(XmlResponse.EN_ERROR, 
     117                                        XmlResponse.CM_INVALID_COMMAND); 
     118                else if (!SessionDataHandler.isEnabledForFileBrowsing(request)) 
    116119                        xr = new XmlResponse(XmlResponse.EN_ERROR, 
    117120                                        XmlResponse.CM_NOT_AUTHORIZED); 
    118                 else if (!CommandHandler.isValidForGet(commandStr)) 
    119                         xr = new XmlResponse(XmlResponse.EN_ERROR, 
    120                                         XmlResponse.CM_INVALID_COMMAND); 
    121121                else if (typeStr != null && !ResourceTypeHandler.isValid(typeStr)) 
    122122                        xr = new XmlResponse(XmlResponse.EN_ERROR, 
     
    134134 
    135135                        File typeDir = new File(typeDirPath); 
    136  
    137136                        if (!typeDir.exists()) { 
    138137                                typeDir.mkdirs(); 
    139                                 // FIXME log typePath or typeDirPath??? 
    140                                 logger.debug("Type dir '{}' successfully created", typePath); 
     138                                logger.debug("Type dir '{}' successfully created", typeDirPath); 
    141139                        } 
    142140 
     
    191189         * It store the file (renaming it in case a file with the same name exists) and then return an 
    192190         * HTML file with a javascript command in it. 
    193          *  
    194191         */ 
    195192        public void doPost(HttpServletRequest request, HttpServletResponse response) 
     
    232229                        || Utils.isEmpty(typeStr)) 
    233230                        ur = UploadResponse.UR_BAD_REQUEST; 
    234                 else if (!commandStr.matches("(File|Quick)Upload")) 
     231                else if (!CommandHandler.isValidForPost(commandStr)) 
    235232                        ur = UploadResponse.UR_SECURITY_ERROR; 
    236233                else if (!UtilsFile.isValidPath(currentFolderStr)) {