MAPG-235 challenge token related error handling
This commit is contained in:
1 parent
3b98570f6d
commit
bbb66ca979
3 files changed
+18
No files matched your search
@@ -48,6 +48,13 @@ class UserInChallengeRepository
|
||||
$withRelations = array_unique(array_merge($withRelations, $necessaryRelations));
|
||||
}
|
||||
|
||||
// validate token string
|
||||
foreach (str_split($token_str) as $char) {
|
||||
if (!(('0' <= $char && $char <= '9') || ('a' <= $char && $char <= 'f'))) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// convert token to int
|
||||
$token = hexdec($token_str);
|
||||
|
||||
$select = new Select(\Container::$dbConnection);
|
||||
|
||||
Reference in new issue
Block a user