You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Richard Emberson (JIRA)" <ji...@apache.org> on 2011/07/04 15:29:21 UTC

[jira] [Commented] (WICKET-3863) SecurePackageResourceGuard acceptAbsolutePath pattern check loop

    [ https://issues.apache.org/jira/browse/WICKET-3863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059429#comment-13059429 ] 

Richard Emberson commented on WICKET-3863:
------------------------------------------

Then why not traverse the patterns in *reverse* order and break after the first one for whcih
pattern.matches(path) == true
setting 
hit = pattern.isInclude();
for that pattern???

boolean hit = false; 
for (SearchPattern pattern : this.pattern.reverse) {
  if ((pattern != null) && pattern.isActive()) {
    if (pattern.matches(path)) {
      hit = pattern.isInclude();
      break;
    }
  }
}


> SecurePackageResourceGuard acceptAbsolutePath pattern check loop 
> -----------------------------------------------------------------
>
>                 Key: WICKET-3863
>                 URL: https://issues.apache.org/jira/browse/WICKET-3863
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC5.1
>         Environment: all
>            Reporter: Richard Emberson
>            Priority: Minor
>
> The following loop might want to break out if a hit (== true) is found:
>     // Check against the pattern
>     boolean hit = false;
>     for (SearchPattern pattern : this.pattern)
>     {
>       if ((pattern != null) && pattern.isActive())
>       {
>         if (pattern.matches(path))
>         {
>           hit = pattern.isInclude();
>         }
>       }
>     }
> as it is, one pattern.isInclued could return true, but the next one false,
> Mayby break out of loop if hit == true???

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira