From e5aaa5db9b323f58d9eb8338532fd04fce885048 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 22 Oct 2012 16:22:37 -0400 Subject: [PATCH] Permission regexes are now case-insensitive --- 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 d115f89..02cc49f 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -692,4 +692,17 @@ } 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 -- Gitblit v1.9.1