Checks that a URI contains the correct hash.
The _hash query string parameter must be the last one (as it is generated that way by the sign() method, it should never be a problem).
string $uri A signed URI:
Boolean True if the URI is signed correctly, false otherwise
public function check($uri) {
if (!preg_match('/^(.*)(?:\\?|&)_hash=(.+?)$/', $uri, $matches)) {
return false;
}
return $this
->computeHash($matches[1]) === $matches[2];
}