diff options
author | James Moger <james.moger@gitblit.com> | 2012-10-22 16:22:37 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-10-22 16:22:37 -0400 |
commit | e5aaa5db9b323f58d9eb8338532fd04fce885048 (patch) | |
tree | f6202d1e79c050dac73a7922803407aee7bc9858 /src/com/gitblit/utils/StringUtils.java | |
parent | ba54242b0d080475bbfce2ab559b3fcf2a513a5b (diff) | |
download | gitblit-e5aaa5db9b323f58d9eb8338532fd04fce885048.tar.gz gitblit-e5aaa5db9b323f58d9eb8338532fd04fce885048.zip |
Permission regexes are now case-insensitive
Diffstat (limited to 'src/com/gitblit/utils/StringUtils.java')
-rw-r--r-- | src/com/gitblit/utils/StringUtils.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java index d115f896..02cc49fd 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -692,4 +692,17 @@ public class StringUtils { }
return path;
}
+
+ /**
+ * Variation of String.matches() which disregards case issues.
+ *
+ * @param regex
+ * @param input
+ * @return true if the pattern matches
+ */
+ public static boolean matchesIgnoreCase(String input, String regex) {
+ Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
+ Matcher m = p.matcher(input);
+ return m.matches();
+ }
}
\ No newline at end of file |