Skip to content

Commit 267f390

Browse files
committed
Namespace fix
1 parent 55212bc commit 267f390

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/SecureFuncs.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public static function decrypt($input, $key)
1717
{
1818
try {
1919
return \Crypto::decrypt($input, $key);
20-
} catch (Ex\InvalidCiphertextException $ex) {
20+
} catch (\Defuse\Crypto\Exception\InvalidCiphertextException $ex) {
2121
die('DANGER! DANGER! The ciphertext has been tampered with!');
22-
} catch (Ex\CryptoTestFailedException $ex) {
22+
} catch (\Defuse\Crypto\Exception\CryptoTestFailedException $ex) {
2323
die('Cannot safely perform decryption');
24-
} catch (Ex\CannotPerformOperationException $ex) {
24+
} catch (\Defuse\Crypto\Exception\CannotPerformOperationException $ex) {
2525
die('Cannot safely perform decryption');
2626
}
2727
}
@@ -41,9 +41,9 @@ public static function encrypt($input, $key = false)
4141

4242
try {
4343
$ciphertext = \Crypto::encrypt($input, $key);
44-
} catch (Ex\CryptoTestFailedException $ex) {
44+
} catch (\Defuse\Crypto\Exception\CryptoTestFailedException $ex) {
4545
die('Cannot safely perform encryption');
46-
} catch (Ex\CannotPerformOperationException $ex) {
46+
} catch (\Defuse\Crypto\Exception\CannotPerformOperationException $ex) {
4747
die('Cannot safely perform encryption');
4848
}
4949

@@ -55,7 +55,7 @@ public static function encrypt($input, $key = false)
5555
* @param $id
5656
* @return md5hash
5757
*/
58-
public function getFormToken($id, $token)
58+
public static function getFormToken($id, $token)
5959
{
6060
if (empty($_SESSION['formtoken'][$id])) {
6161
return false;
@@ -87,9 +87,9 @@ public static function password_verify($password, $hash)
8787
* @param $id
8888
* @return md5hash
8989
*/
90-
public function setFormToken($id)
90+
public static function setFormToken($id)
9191
{
92-
$_SESSION['formtoken'][$id] = $this->randomString(100);
92+
$_SESSION['formtoken'][$id] = self::randomString(100);
9393
return md5($_SESSION['formtoken'][$id]);
9494
}
9595

@@ -136,9 +136,9 @@ public static function randomSecureKey()
136136
{
137137
try {
138138
return \Crypto::createNewRandomKey();
139-
} catch (Ex\CryptoTestFailedException $ex) {
139+
} catch (\Defuse\Crypto\Exception\CryptoTestFailedException $ex) {
140140
die('Cannot safely create a key');
141-
} catch (Ex\CannotPerformOperationException $ex) {
141+
} catch (\Defuse\Crypto\Exception\CannotPerformOperationException $ex) {
142142
die('Cannot safely create a key');
143143
}
144144
}

0 commit comments

Comments
 (0)