From f2cda5dd6c23d56dd2d3880a6f7207f4d219a8fc Mon Sep 17 00:00:00 2001 From: Wiktor Kwapisiewicz Date: Wed, 18 Oct 2017 21:20:25 +0200 Subject: [PATCH] Accept dash character (-) in GitHub user names when checking for Gist URL GitHub allows dash / minus characters in usernames (e.g. "wiktor-k" or "open-keychain"). This change extends the regular expression to capture this missing character. --- .../keychain/linked/resources/GithubResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java index 2e06b594f..89dd24b00 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java @@ -192,7 +192,7 @@ public class GithubResource extends LinkedTokenResource { return null; } - Pattern p = Pattern.compile("https://gist\\.github\\.com/([a-zA-Z0-9_]+)/([0-9a-f]+)"); + Pattern p = Pattern.compile("https://gist\\.github\\.com/([a-zA-Z0-9_-]+)/([0-9a-f]+)"); Matcher match = p.matcher(uri.toString()); if (!match.matches()) { return null;