You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2015/11/12 10:34:56 UTC
svn commit: r1713991 - in /ofbiz/trunk:
framework/base/src/org/ofbiz/base/util/UtilCodec.java
framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrContextFilter.java
Author: jleroux
Date: Thu Nov 12 09:34:56 2015
New Revision: 1713991
URL: http://svn.apache.org/viewvc?rev=1713991&view=rev
Log:
Non functional changes
Removes useless commented out code in UtilCodec.java
Replaces a tab by spaces in ContextFilter.java
Removes useless line in OFBizSolrContextFilter.java (annoying in compare)
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilCodec.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrContextFilter.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilCodec.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilCodec.java?rev=1713991&r1=1713990&r2=1713991&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilCodec.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilCodec.java Thu Nov 12 09:34:56 2015
@@ -259,34 +259,6 @@ public class UtilCodec {
errorMessageList.add("In field [" + valueName + "] less-than (<) and greater-than (>) symbols are not allowed.");
}
- /* NOTE DEJ 20090311: After playing with this more this doesn't seem to be necessary; the canonicalize will convert all such characters into actual text before this check is done, including other illegal chars like < which will canonicalize to < and then get caught
- // check for & followed a semicolon within 7 characters, no spaces in-between (and perhaps other things sometime?)
- int curAmpIndex = value.indexOf("&");
- while (curAmpIndex > -1) {
- int semicolonIndex = value.indexOf(";", curAmpIndex + 1);
- int spaceIndex = value.indexOf(" ", curAmpIndex + 1);
- if (semicolonIndex > -1 && (semicolonIndex - curAmpIndex <= 7) && (spaceIndex < 0 || (spaceIndex > curAmpIndex && spaceIndex < semicolonIndex))) {
- errorMessageList.add("In field [" + valueName + "] the ampersand (&) symbol is only allowed if not used as an encoded character: no semicolon (;) within 7 spaces or there is a space between.");
- // once we find one like this we have the message so no need to check for more
- break;
- }
- curAmpIndex = value.indexOf("&", curAmpIndex + 1);
- }
- */
-
- /* NOTE DEJ 20090311: After playing with this more this doesn't seem to be necessary; the canonicalize will convert all such characters into actual text before this check is done, including other illegal chars like %3C which will canonicalize to < and then get caught
- // check for % followed by 2 hex characters
- int curPercIndex = value.indexOf("%");
- while (curPercIndex >= 0) {
- if (value.length() > (curPercIndex + 3) && UtilValidate.isHexDigit(value.charAt(curPercIndex + 1)) && UtilValidate.isHexDigit(value.charAt(curPercIndex + 2))) {
- errorMessageList.add("In field [" + valueName + "] the percent (%) symbol is only allowed if followed by a space.");
- // once we find one like this we have the message so no need to check for more
- break;
- }
- curPercIndex = value.indexOf("%", curPercIndex + 1);
- }
- */
-
// TODO: anything else to check for that can be used to get HTML or JavaScript going without these characters?
return value;
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=1713991&r1=1713990&r2=1713991&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Thu Nov 12 09:34:56 2015
@@ -257,7 +257,6 @@ public class ContextFilter implements Fi
// get tenant delegator by domain name
String serverName = httpRequest.getServerName();
try {
-
// if tenant was specified, replace delegator with the new per-tenant delegator and set tenantId to session attribute
Delegator delegator = getDelegator(config.getServletContext());
Modified: ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrContextFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrContextFilter.java?rev=1713991&r1=1713990&r2=1713991&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrContextFilter.java (original)
+++ ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrContextFilter.java Thu Nov 12 09:34:56 2015
@@ -40,9 +40,9 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import org.apache.solr.core.NodeConfig;
import org.apache.solr.common.SolrException;
import org.apache.solr.core.CoreContainer;
+import org.apache.solr.core.NodeConfig;
import org.apache.solr.servlet.SolrDispatchFilter;
import org.ofbiz.base.conversion.ConversionException;
import org.ofbiz.base.conversion.JSONConverters.MapToJSON;
@@ -181,7 +181,7 @@ public class OFBizSolrContextFilter exte
// check if the request is from an authorized user
if (UtilValidate.isNotEmpty(servletPath) && (servletPath.startsWith("/admin/") || servletPath.endsWith("/update")
|| servletPath.endsWith("/update/json") || servletPath.endsWith("/update/csv") || servletPath.endsWith("/update/extract")
- || servletPath.endsWith("/replication") || servletPath.endsWith("/file") || servletPath.endsWith("/file/"))) {
+ || servletPath.endsWith("/replication") || servletPath.endsWith("/file") || servletPath.endsWith("/file/"))) {
HttpSession session = httpRequest.getSession();
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
Security security = (Security) request.getAttribute("security");
@@ -217,9 +217,9 @@ public class OFBizSolrContextFilter exte
} catch (ConversionException e) {
Debug.logError("Error while converting Solr ofbizLogin map to JSON.", module);
} finally {
- if (os != null) {
- os.close();
- }
+ if (os != null) {
+ os.close();
+ }
}
return;
} else if (servletPath.endsWith("/update") || servletPath.endsWith("/update/json") || servletPath.endsWith("/update/csv") || servletPath.endsWith("/update/extract")) {
@@ -252,9 +252,9 @@ public class OFBizSolrContextFilter exte
} catch (ConversionException e) {
Debug.logError("Error while converting responseHeader map to JSON.", module);
} finally {
- if (os != null) {
- os.close();
- }
+ if (os != null) {
+ os.close();
+ }
}
return;
}
@@ -287,9 +287,9 @@ public class OFBizSolrContextFilter exte
} catch (ConversionException e) {
Debug.logError("Error while converting responseHeader map to JSON.", module);
} finally {
- if (os != null) {
- os.close();
- }
+ if (os != null) {
+ os.close();
+ }
}
return;
}
@@ -322,9 +322,9 @@ public class OFBizSolrContextFilter exte
} catch (ConversionException e) {
Debug.logError("Error while converting responseHeader map to JSON.", module);
} finally {
- if (os != null) {
- os.close();
- }
+ if (os != null) {
+ os.close();
+ }
}
return;
}
@@ -450,7 +450,6 @@ public class OFBizSolrContextFilter exte
// get tenant delegator by domain name
String serverName = httpRequest.getServerName();
try {
-
// if tenant was specified, replace delegator with the new per-tenant delegator and set tenantId to session attribute
Delegator delegator = getDelegator(config.getServletContext());