Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanitise tags from invalid characters #7

Open
wants to merge 2 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

don't reassign input param

  • Loading branch information
linakis committed Oct 24, 2018
commit 1fedac5a67927cb1cf20239785bec4ddc2ff1818
@@ -223,13 +223,13 @@ private String joinStrings(Collection<String> messages) {
*/
private String sanitizeTag(String tag) {
// replace invalid characters with _
tag = tag.replaceAll("[^A-Za-z0-9_*,.\\-]", "_");
String sanitized = tag.replaceAll("[^A-Za-z0-9_*,.\\-]", "_");

// don't allow non-alphanumeric values starting the tag
if (Character.isLetterOrDigit(tag.charAt(0))) {
return tag;
return sanitized;
}

return tag.substring(1);
return sanitized.substring(1);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.