mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-02 11:36:08 -04:00
avoid duplication of ID check
This commit is contained in:
parent
629f263cf5
commit
7825471d70
3 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue