avoid duplication of ID check

This commit is contained in:
El RIDO 2025-03-13 08:14:01 +01:00
parent 629f263cf5
commit 7825471d70
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
3 changed files with 8 additions and 3 deletions

View file

@ -12,6 +12,7 @@
namespace PrivateBin;
use Exception;
use PrivateBin\Model\Paste;
/**
* Request
@ -84,7 +85,7 @@ class Request
foreach ($_GET as $key => $value) {
// only return if value is empty and key is 16 hex chars
$key = (string) $key;
if (($value === '') && strlen($key) === 16 && ctype_xdigit($key)) {
if (empty($value) && Paste::isValidId($key)) {
return $key;
}
}