diff --git a/UriSigner.php b/UriSigner.php index 526a919738..66fba97266 100644 --- a/UriSigner.php +++ b/UriSigner.php @@ -75,7 +75,7 @@ public function check($uri) $hash = urlencode($params['_hash']); unset($params['_hash']); - return $this->computeHash($this->buildUrl($url, $params)) === $hash; + return hash_equals($this->computeHash($this->buildUrl($url, $params)), $hash); } private function computeHash($uri) diff --git a/composer.json b/composer.json index e082b2a32d..5526e718f1 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "symfony/http-foundation": "~2.7.36|~2.8.29|~3.1.6", "symfony/debug": "^2.6.2", "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php56": "~1.8", "psr/log": "~1.0" }, "require-dev": {