You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Brian Demers (Jira)" <ji...@apache.org> on 2021/05/26 14:22:00 UTC
[jira] [Updated] (SHIRO-821) Difference in behaviour when matching
regex patterns with trailing spaces between shiro-core v1.7.0 and v1.7.1
[ https://issues.apache.org/jira/browse/SHIRO-821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Demers updated SHIRO-821:
-------------------------------
Description:
Hi,
Not sure if this is a bug but there appears to be a difference in the way regex patterns with trailing spaces are matched in shiro-core. This behavior seems to have changed between v1.7.0 and v1.7.1.
Steps to replicate:
RegexTest.java:
{code:java}
import org.apache.shiro.util.AntPathMatcher;
public class RegexTest {
public static void main(String[] args)
{
AntPathMatcher matcher = new AntPathMatcher();
System.out.println("Matching ====" + "/a/b/* " + "==== with ====" + "/a/b/c" + "====");
System.out.println("RESULT: " + matcher.match("/a/b/* ", "/a/b/c"));
}
}
{code}
Output with v1.7.0:
$ java -cp "shiro-core-1.7.0.jar;." RegexTest
Matching ====/a/b/* ==== with ====/a/b/c====
RESULT: *true*
Output with v1.7.1:
$ java -cp "shiro-core-1.7.1.jar;." RegexTest
Matching ====/a/b/* ==== with ====/a/b/c====
RESULT: *false*
Can you please let me know if this change was an intentional fix to an existing bug or a new bug that got introduced?
Is there any flag to retain the prior behavior?
-Thanks
was:
Hi,
Not sure if this is a bug but there appears to be a difference in the way regex patterns with trailing spaces are matched in shiro-core. This behavior seems to have changed between v1.7.0 and v1.7.1.
Steps to replicate:
RegexTest.java:
{code:java}
import org.apache.shiro.util.AntPathMatcher;
public class RegexTest {
public static void main(String[] args)
{
AntPathMatcher matcher = new AntPathMatcher(); System.out.println("Matching ====" + "/a/b/* " + "==== with ====" + "/a/b/c" + "====");
System.out.println("RESULT: " + matcher.match("/a/b/* ", "/a/b/c"));
}
}
{code}
Output with v1.7.0:
$ java -cp "shiro-core-1.7.0.jar;." RegexTest
Matching ====/a/b/* ==== with ====/a/b/c====
RESULT: *true*
Output with v1.7.1:
$ java -cp "shiro-core-1.7.1.jar;." RegexTest
Matching ====/a/b/* ==== with ====/a/b/c====
RESULT: *false*
Can you please let me know if this change was an intentional fix to an existing bug or a new bug that got introduced?
Is there any flag to retain the prior behavior?
-Thanks
> Difference in behaviour when matching regex patterns with trailing spaces between shiro-core v1.7.0 and v1.7.1
> --------------------------------------------------------------------------------------------------------------
>
> Key: SHIRO-821
> URL: https://issues.apache.org/jira/browse/SHIRO-821
> Project: Shiro
> Issue Type: Bug
> Affects Versions: 1.7.1
> Reporter: Srinidhi
> Priority: Major
>
> Hi,
> Not sure if this is a bug but there appears to be a difference in the way regex patterns with trailing spaces are matched in shiro-core. This behavior seems to have changed between v1.7.0 and v1.7.1.
> Steps to replicate:
> RegexTest.java:
> {code:java}
> import org.apache.shiro.util.AntPathMatcher;
> public class RegexTest {
> public static void main(String[] args)
> {
> AntPathMatcher matcher = new AntPathMatcher();
> System.out.println("Matching ====" + "/a/b/* " + "==== with ====" + "/a/b/c" + "====");
> System.out.println("RESULT: " + matcher.match("/a/b/* ", "/a/b/c"));
> }
> }
> {code}
>
>
> Output with v1.7.0:
> $ java -cp "shiro-core-1.7.0.jar;." RegexTest
> Matching ====/a/b/* ==== with ====/a/b/c====
> RESULT: *true*
>
> Output with v1.7.1:
> $ java -cp "shiro-core-1.7.1.jar;." RegexTest
> Matching ====/a/b/* ==== with ====/a/b/c====
> RESULT: *false*
>
> Can you please let me know if this change was an intentional fix to an existing bug or a new bug that got introduced?
> Is there any flag to retain the prior behavior?
>
> -Thanks
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)