mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 22:43:20 -05:00
debug captcha: use safe alphabets only
Signed-off-by: hrj <harshad.rj@gmail.com>
This commit is contained in:
parent
41bdbc7fbf
commit
b765399f68
@ -11,13 +11,15 @@ public class HelperFunctions {
|
||||
RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
|
||||
}
|
||||
|
||||
public static final String alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
public static final String numbers = "23456789";
|
||||
public static final String safeAlphabets = "ABCDEFGHJKMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
public static final String allAlphabets = safeAlphabets + "ILl";
|
||||
public static final String safeNumbers = "23456789";
|
||||
public static final String allNumbers = safeNumbers + "1";
|
||||
public static final String specialCharacters = "$#%@&?";
|
||||
public static final String allCharacters = alphabets + numbers + specialCharacters;
|
||||
public static final String safeCharacters = safeAlphabets + safeNumbers + specialCharacters;
|
||||
|
||||
public static String randomString(final int n) {
|
||||
return randomString(n, allCharacters);
|
||||
return randomString(n, safeCharacters);
|
||||
}
|
||||
|
||||
public static String randomString(final int n, final String characters) {
|
||||
|
@ -58,7 +58,7 @@ class DebugCaptcha extends ChallengeProvider {
|
||||
}
|
||||
|
||||
def returnChallenge(): Challenge = {
|
||||
val secret = HelperFunctions.randomString(6, HelperFunctions.alphabets)
|
||||
val secret = HelperFunctions.randomString(6, HelperFunctions.safeAlphabets)
|
||||
new Challenge(simpleText(secret), "image/png", secret.toLowerCase())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user