mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-06 02:39:59 +02:00
update minimum required PHP version to 5.6 and replace slowEquals() with native hash_equals() function
This commit is contained in:
parent
2870023e9c
commit
5d54006c9e
4 changed files with 3 additions and 37 deletions
|
@ -35,7 +35,7 @@ class Controller
|
|||
*
|
||||
* @const string
|
||||
*/
|
||||
const MIN_PHP_VERSION = '5.5.0';
|
||||
const MIN_PHP_VERSION = '5.6.0';
|
||||
|
||||
/**
|
||||
* show the same error message if the paste expired or does not exist
|
||||
|
@ -276,9 +276,7 @@ class Controller
|
|||
// accessing this method ensures that the paste would be
|
||||
// deleted if it has already expired
|
||||
$paste->get();
|
||||
if (
|
||||
Filter::slowEquals($deletetoken, $paste->getDeleteToken())
|
||||
) {
|
||||
if (hash_equals($paste->getDeleteToken(), $deletetoken)) {
|
||||
// Paste exists and deletion token is valid: Delete the paste.
|
||||
$paste->delete();
|
||||
$this->_status = 'Paste was properly deleted.';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue