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 21:12:00 UTC
[jira] [Comment Edited] (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:comment-tabpanel&focusedCommentId=17352049#comment-17352049 ]
Brian Demers edited comment on SHIRO-821 at 5/26/21, 9:11 PM:
--------------------------------------------------------------
That looks like a bug to me that has now been corrected. `"/a/b/* "` will match `"a/b/c "` and `"a/b/cd "`
Can you describe how you were using this functionality in the previous version?
was (Author: bdemers):
That looks like a bug to me that has now been corrected. `"/a/b/* "` will match `"a/b/c "` and `"a/b/cd "`
Can you describe how you were previously using/depending on the previous usage?
> 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)