@@ -17,11 +17,11 @@ public static function decrypt($input, $key)
17
17
{
18
18
try {
19
19
return \Crypto::decrypt ($ input , $ key );
20
- } catch (Ex \InvalidCiphertextException $ ex ) {
20
+ } catch (\ Defuse \ Crypto \ Exception \InvalidCiphertextException $ ex ) {
21
21
die ('DANGER! DANGER! The ciphertext has been tampered with! ' );
22
- } catch (Ex \CryptoTestFailedException $ ex ) {
22
+ } catch (\ Defuse \ Crypto \ Exception \CryptoTestFailedException $ ex ) {
23
23
die ('Cannot safely perform decryption ' );
24
- } catch (Ex \CannotPerformOperationException $ ex ) {
24
+ } catch (\ Defuse \ Crypto \ Exception \CannotPerformOperationException $ ex ) {
25
25
die ('Cannot safely perform decryption ' );
26
26
}
27
27
}
@@ -41,9 +41,9 @@ public static function encrypt($input, $key = false)
41
41
42
42
try {
43
43
$ ciphertext = \Crypto::encrypt ($ input , $ key );
44
- } catch (Ex \CryptoTestFailedException $ ex ) {
44
+ } catch (\ Defuse \ Crypto \ Exception \CryptoTestFailedException $ ex ) {
45
45
die ('Cannot safely perform encryption ' );
46
- } catch (Ex \CannotPerformOperationException $ ex ) {
46
+ } catch (\ Defuse \ Crypto \ Exception \CannotPerformOperationException $ ex ) {
47
47
die ('Cannot safely perform encryption ' );
48
48
}
49
49
@@ -55,7 +55,7 @@ public static function encrypt($input, $key = false)
55
55
* @param $id
56
56
* @return md5hash
57
57
*/
58
- public function getFormToken ($ id , $ token )
58
+ public static function getFormToken ($ id , $ token )
59
59
{
60
60
if (empty ($ _SESSION ['formtoken ' ][$ id ])) {
61
61
return false ;
@@ -87,9 +87,9 @@ public static function password_verify($password, $hash)
87
87
* @param $id
88
88
* @return md5hash
89
89
*/
90
- public function setFormToken ($ id )
90
+ public static function setFormToken ($ id )
91
91
{
92
- $ _SESSION ['formtoken ' ][$ id ] = $ this -> randomString (100 );
92
+ $ _SESSION ['formtoken ' ][$ id ] = self :: randomString (100 );
93
93
return md5 ($ _SESSION ['formtoken ' ][$ id ]);
94
94
}
95
95
@@ -136,9 +136,9 @@ public static function randomSecureKey()
136
136
{
137
137
try {
138
138
return \Crypto::createNewRandomKey ();
139
- } catch (Ex \CryptoTestFailedException $ ex ) {
139
+ } catch (\ Defuse \ Crypto \ Exception \CryptoTestFailedException $ ex ) {
140
140
die ('Cannot safely create a key ' );
141
- } catch (Ex \CannotPerformOperationException $ ex ) {
141
+ } catch (\ Defuse \ Crypto \ Exception \CannotPerformOperationException $ ex ) {
142
142
die ('Cannot safely create a key ' );
143
143
}
144
144
}
0 commit comments