mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged DEV to HEAD
48863: ALF-18012 Error occurs on search by wildcards on Start Workflow page - []{} symbols escaped in GetAuthoritiesCannedQuery.getPattern(String). Also neatened the replacement to be self-documenting git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@48865 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -119,9 +119,17 @@ public class GetAuthoritiesCannedQuery extends AbstractCannedQueryPermissions<Au
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escapes: \ with \\ and . with \.
|
// Escape characters of regex expressions
|
||||||
// Replaces ? with . and * with .*
|
searchValue =
|
||||||
searchValue = "^"+searchValue.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\.", "\\\\.").replaceAll("\\?", ".").replaceAll("\\*", ".*");
|
"^" +
|
||||||
|
searchValue.replaceAll("\\\\", "\\\\\\\\")
|
||||||
|
.replaceAll("\\.", "\\\\.")
|
||||||
|
.replaceAll("\\?", ".")
|
||||||
|
.replaceAll("\\*", ".*")
|
||||||
|
.replaceAll("\\{", "\\\\{")
|
||||||
|
.replaceAll("\\}", "\\\\}")
|
||||||
|
.replaceAll("\\[", "\\\\[")
|
||||||
|
.replaceAll("\\]", "\\\\]");
|
||||||
return Pattern.compile(searchValue, Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(searchValue, Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user