-
Bug
-
Resolution: Fixed
-
Critical
-
4.3.2
-
None
-
1.6.0_07 and 1.6.0_16, win32.
As of 4.3.2, in which the constant URL_CHAR_PATTERN in SimpleUrlPattern was changed, some URL pattern matches cause hang-ups.
import info.magnolia.cms.util.SimpleUrlPattern; import org.junit.Assert; import org.junit.Test; public class SimpleUrlPatternTest { @Test public void testDotDoPattern() { final SimpleUrlPattern sup = new SimpleUrlPattern("*\\.do"); Assert.assertTrue(sup.match("/path/myController.do")); //This still works Assert.assertFalse(sup.match("/.resources/enterprise-css/registration.css")); //This hangs up } }
I noticed this because I have a URL bypass for Spring controller URLs which I've mapped to *.do extensions.
It seems SimpleUrlPattern converts
*\\.do
to
()(.*\\n*)*\\.do
internally, which causes an infinite loop in java.util.regex.Pattern. I tested this with both JDK 1.6.0_07 and 1.6.0_16.
Acceptance criteria
- caused by
-
MAGNOLIA-3198 SimpleUrlPattern.URL_CHAR_PATTERN block newlines chars
- Closed