From 90a11efecd0c87feff40a25504e1cf29332d7d08 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 4 Aug 2015 21:41:33 +0200 Subject: [PATCH] Remove "use" statement Ref https://bugs.php.net/bug.php?id=66773 --- lib/private/appframework/http/request.php | 3 +-- lib/private/security/crypto.php | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php index 6f108fedc6..43f01dfde3 100644 --- a/lib/private/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -33,7 +33,6 @@ use OC\Security\TrustedDomainHelper; use OCP\IConfig; use OCP\IRequest; use OCP\Security\ISecureRandom; -use OCP\Security\StringUtils; /** * Class for accessing variables in the request. @@ -417,7 +416,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { } // Check if the token is valid - if(StringUtils::equals($token, $this->items['requesttoken'])) { + if(\OCP\Security\StringUtils::equals($token, $this->items['requesttoken'])) { return true; } else { return false; diff --git a/lib/private/security/crypto.php b/lib/private/security/crypto.php index 5a7073e950..9bae1d6992 100644 --- a/lib/private/security/crypto.php +++ b/lib/private/security/crypto.php @@ -27,7 +27,6 @@ use phpseclib\Crypt\AES; use phpseclib\Crypt\Hash; use OCP\Security\ICrypto; use OCP\Security\ISecureRandom; -use OCP\Security\StringUtils; use OCP\IConfig; /** @@ -50,6 +49,10 @@ class Crypto implements ICrypto { /** @var ISecureRandom */ private $random; + /** + * @param IConfig $config + * @param ISecureRandom $random + */ function __construct(IConfig $config, ISecureRandom $random) { $this->cipher = new AES(); $this->config = $config; @@ -119,7 +122,7 @@ class Crypto implements ICrypto { $this->cipher->setIV($iv); - if(!StringUtils::equals($this->calculateHMAC($parts[0].$parts[1], $password), $hmac)) { + if(!\OCP\Security\StringUtils::equals($this->calculateHMAC($parts[0].$parts[1], $password), $hmac)) { throw new \Exception('HMAC does not match.'); }