Accept patch [2788801] MAttachementEntry.java patch

Thanks to Muhammad Faisal Shahzad (ro2)
This commit is contained in:
Carlos Ruiz 2009-05-08 15:18:09 +00:00
parent fa69ebfcef
commit 73efd701fd
5 changed files with 307 additions and 304 deletions

View File

@ -603,7 +603,7 @@ public class ReportStarter implements ProcessCall, ClientProcess
MAttachmentEntry[] entries = attachment.getEntries();
for(int i = 0; i < entries.length; i++) {
if (!entries[i].getName().equals(name) &&
(entries[i].getName().endsWith(".jrxml") || entries[i].getName().endsWith(".jasper"))) {
(entries[i].getName().toLowerCase().endsWith(".jrxml") || entries[i].getName().toLowerCase().endsWith(".jasper"))) {
File reportFile = getAttachmentEntryFile(entries[i]);
if (reportFile != null)
subreports.add(reportFile);

View File

@ -1,4 +1,4 @@
/**********************************************************************
/***********************************************************************
* This file is part of Adempiere ERP Bazaar *
* http://www.adempiere.org *
* *
@ -25,7 +25,7 @@
* *
* Sponsors: *
* - Company (http://www.faire.com.br) *
***********************************************************************/
**********************************************************************/
package org.adempiere.process;
@ -67,7 +67,7 @@ public class PrepareMigrationScripts extends SvrProcess {
FilenameFilter filter = new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.endsWith(".sql");
return name.toLowerCase().endsWith(".sql");
}
};
dirList = dir.listFiles(filter);

View File

@ -260,16 +260,17 @@ public class MAttachmentEntry
*/
public boolean isPDF()
{
return m_name.endsWith(".pdf");
return m_name.toLowerCase().endsWith(".pdf");
} // isPDF
/**
* Isattachment entry a Graphic
* Is attachment entry a Graphic
* @return true if *.gif, *.jpg, *.png
*/
public boolean isGraphic()
{
return m_name.endsWith(".gif") || m_name.endsWith(".jpg") || m_name.endsWith(".png");
String m_lowname = m_name.toLowerCase();
return m_lowname.endsWith(".gif") || m_lowname.endsWith(".jpg") || m_lowname.endsWith(".png");
} // isGraphic

View File

@ -54,7 +54,7 @@ public class GetReportAction extends POSAction
String mimeType = null;
if(reportName.endsWith(".csv"))
if(reportName.toLowerCase().endsWith(".csv"))
{
mimeType = "text/comma-separated-values";
}

View File

@ -139,10 +139,12 @@ public final class WFilter implements javax.servlet.Filter
// Get URI
String uri = "";
String urilow = "";
if (request instanceof HttpServletRequest)
{
HttpServletRequest req = (HttpServletRequest)request;
uri = req.getRequestURI();
urilow = uri.toLowerCase();
}
@ -171,9 +173,9 @@ public final class WFilter implements javax.servlet.Filter
else
pass = false;
else if (!uri.startsWith(WebEnv.DIR_BASE) // not requesting /adempiere/...
|| uri.endsWith(".gif") || uri.endsWith(".jpg") || uri.endsWith(".png")
|| uri.endsWith(".html") || uri.endsWith(".css")
|| uri.endsWith(".js"))
|| urilow.endsWith(".gif") || urilow.endsWith(".jpg") || urilow.endsWith(".png")
|| urilow.endsWith(".html") || urilow.endsWith(".css")
|| urilow.endsWith(".js"))
check = false;
else
;