update minimum required PHP version to 5.6 and replace slowEquals() with native hash_equals() function

This commit is contained in:
El RIDO 2020-02-05 19:30:14 +01:00
parent 2870023e9c
commit 5d54006c9e
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 3 additions and 37 deletions

View file

@ -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.';