mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
handle tracker check user exception
This commit is contained in:
@@ -298,7 +298,11 @@ class TrackerRepository extends BaseRepository
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw new TrackerException("Invalid user $field: $value.");
|
throw new TrackerException("Invalid user $field: $value.");
|
||||||
}
|
}
|
||||||
$user->checkIsNormal();
|
try {
|
||||||
|
$user->checkIsNormal();
|
||||||
|
} catch (\Throwable $exception) {
|
||||||
|
throw new TrackerException($exception->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
if ($user->parked == 'yes') {
|
if ($user->parked == 'yes') {
|
||||||
throw new TrackerException("Your account is parked! (Read the FAQ)");
|
throw new TrackerException("Your account is parked! (Read the FAQ)");
|
||||||
@@ -829,8 +833,8 @@ class TrackerRepository extends BaseRepository
|
|||||||
throw new TrackerException("key: info_hash is Missing !");
|
throw new TrackerException("key: info_hash is Missing !");
|
||||||
} else {
|
} else {
|
||||||
foreach ($info_hash_array as $item) {
|
foreach ($info_hash_array as $item) {
|
||||||
if (strlen($item) != 20) {
|
if (($length = strlen($item)) != 20) {
|
||||||
throw new TrackerException("Invalid info_hash ! info_hash is not 20 bytes long");
|
throw new TrackerException("Invalid info_hash ! info_hash is not 20 bytes long($length)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user