Implements a PagedList object (stores list of data items, resultset size, viewSize, viewIndex, lowIndex (called startIndex) and highIndex (called endIndex), also a utils class that returns the PagedList object based on a EntityListIterator, viewSize and viewIndex.
And implements a queryPagedList method in EntityQuery, used as an example in findOrders service Java implementation
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738900 13f79535-47bb-0310-9956-ffa450edef68
Since commons.httpclient.HttpClient is now deprecated/not-maintained an vulnerable I prefer to simply put a warning at the top of the class. So people can pick what they prefer and is handy for their problem at than
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1737695 13f79535-47bb-0310-9956-ffa450edef68
Log:
==========================================================
- Make use of ResourceLoader.readXmlRootElement, which is
non-caching; this fixes a deprecation warning.
- Use ResourceLoader.readXmlRootElement, which is a
non-caching version. This fixes a deprecation warning.
- Provide method variants (readXml{Document,RootElement}) that contain the body of the deprecated methods (getXml{Document,RootElement}).
==========================================================
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731399 13f79535-47bb-0310-9956-ffa450edef68
Log:
============================================================
UtilDateTime implements deprecated methods, so add the
@Deprecated tag to stop javac from producing a warning.
============================================================
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731385 13f79535-47bb-0310-9956-ffa450edef68
Log:
============================================================
new Configuration() is deprecated; instead, the desired
freemarker version should be passed in. To make it easier to control
the version centrally, add a helper method on FreeMarkerWorker that
wraps the instantiation of the Configuration object.
============================================================
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731380 13f79535-47bb-0310-9956-ffa450edef68
Since OFBIZ-6867 is now done, it will no longer be used OOTB and anyway should not be needed because we should preferably always use sessionIds in cookies and newer have sessionsIds in URLs.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1728121 13f79535-47bb-0310-9956-ffa450edef68
Removes useless commented out code in UtilCodec.java
Replaces a tab by spaces in ContextFilter.java
Removes useless line and replaces tabs by spaces in OFBizSolrContextFilter.java (annoying in compare)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713991 13f79535-47bb-0310-9956-ffa450edef68
As explained in OFBIZ-6669 last comments, contrary to what I did in ContentWorker class, when I before did the work on *ContentWrapper classes I did not use the sanitizer but only an encoder (either HTML or URL).
Because I wrongly supposed that only plain text was used there and certainly my lazy mind thought it was easier because of the URL encoderType to also handle.
When the encoderType is HTML, we now use the sanitizer in *ContentWrapper classes, and ContentWorker.java has also been adapted.
For that I enhanced the UtilCodec class. The sanitizer is only used when HTML is requested, else the sanitize() method simply calls the encode() method.
I removed the content.sanitize property in content.properties and added a sanitizer.permissive.policy property in the new owasp.properties (in base config) with some explanations. This allows for more configuration.
I changed the line 85 in productsummary.ftl to use an HTML content wrapper, same in minilastviewedcategories.ftl.
To be totally complete, we should change *lines like* in productsummary.ftl line 85 to use an HTML content wrapper.
Not easy to spot but anyway those not done will simply not totally show well, without any security impacts.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713634 13f79535-47bb-0310-9956-ffa450edef68
SimpleContentViewHandler will return mime type 'text/html' for all DataResource values without a specified mimeTypeId. Changing to DataResourceWorker.getMimeType will allow determining the mimeTypeId by file extension
Fixing the mime type will allow the browsers to display content inline if UtilHttp is updated aswell. All unknown extensions will be set to octet-stream causing the browser to prompt for download
jleroux: after some discussions, this finally uses a content-disposition-type property in requestHandler.properties to allow more flexibility for users (see UtilHttp.setContentDisposition() method). Beware "inline" is less secure. For this reason, Gareth forced the "dangerous" text/html mime type to application/octet-stream in SimpleContentViewHandler class. This to prevent possible static XSS attacks. See the Jira issue for more details.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712835 13f79535-47bb-0310-9956-ffa450edef68
The ProductStore has the defaultLocaleString and the defaultCurrencyUomId but does not have a defaultTimeZoneString. What happens when a store is selected (from e-commerce or the POS) is that it will look to the user for a lastTimeZone and if that is not set, it would simply revert to the TimeZone.getDefault() (so the timezone based on the server).
The trouble we had was that you may have an application server that is running in a completely different timezone than what is desired for the store.
jleroux: see comments in the Jira issue for the modifications I did
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712347 13f79535-47bb-0310-9956-ffa450edef68
Introduces a private inner class ListSet representing a Set backed by a List instead of the HashSet implementation.
Thanks Gareth Carter for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703954 13f79535-47bb-0310-9956-ffa450edef68
There is an error in isValidEan util. It should be 12 and not 13 in the methods charAt and calcChecksum because they start at 0.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703586 13f79535-47bb-0310-9956-ffa450edef68
This reverts svn:eol-style=native on Java files which were forced by r1044202n, 89 Java files are concerned. This commit hopefully makes things more consistent.
It's indeed hard to see the impact of this change before it's committed. I'll check once done, I already found 116 Java files w/o svn:eol-style=native but there are 1231 Java files at all, so not sure how most are set...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695126 13f79535-47bb-0310-9956-ffa450edef68
streamContentToBrowser fails when the file name contains a comma, happens only with Google Chrome.
Can easily be reproduced for example by uploading the Logo Image URL of the default organization in the party manager, that includes a comma of course.
Fixed in my patch by wrapping the file name in quotes.
Error on the browser console:
GET https://localhost:8443/content/control/stream?contentId=10020 net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
jleroux: at 1935.1 section of http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html I read this example << Content-Disposition: attachment; filename="fname.ext">> So Francis's solution is the right one
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1690086 13f79535-47bb-0310-9956-ffa450edef68
* two-way encryption is now delegated to Apache Shiro, with stronger initialization vectors
* the mechanism is backward compatible
* new tools to update the encryption of private keys, useful to upgrade older versions of OFBiz and most of all to replace old keys with new ones (this is critical to implement stronger security practices as requested by PCI)
* unit tests
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684608 13f79535-47bb-0310-9956-ffa450edef68
Ignoring a thrown ClassCastException is a common pattern in the project (one I have used myself), but it should be avoided in the future because it makes debugging difficult, plus it creates objects unnecessarily.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1680058 13f79535-47bb-0310-9956-ffa450edef68
1. Class path loading was ignoring component settings, so class paths for disabled components were being loaded.
2. Configuration files were parsed twice.
3. Potential problem with unloading a loader that failed loading.
I was unable to test Cobertura because the necessary class (org.ofbiz.base.config.CoberturaInstrumenter) isn't being compiled for some reason.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676746 13f79535-47bb-0310-9956-ffa450edef68
This should fix, at least as a temporary solution, the recent issues happening after the upgrade to the new ESAPI.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1659224 13f79535-47bb-0310-9956-ffa450edef68