@@ -55,15 +55,21 @@ public function __construct(
55
55
) {
56
56
$ this ->_cipher = $ cipher ;
57
57
$ this ->_mode = $ mode ;
58
+ // @codingStandardsIgnoreStart
58
59
$ this ->_handle = @mcrypt_module_open ($ cipher , '' , $ mode , '' );
60
+ // @codingStandardsIgnoreEnd
59
61
try {
62
+ // @codingStandardsIgnoreStart
60
63
$ maxKeySize = @mcrypt_enc_get_key_size ($ this ->_handle );
64
+ // @codingStandardsIgnoreEnd
61
65
if (strlen ($ key ) > $ maxKeySize ) {
62
66
throw new \Magento \Framework \Exception \LocalizedException (
63
67
new \Magento \Framework \Phrase ('Key must not exceed %1 bytes. ' , [$ maxKeySize ])
64
68
);
65
69
}
70
+ // @codingStandardsIgnoreStart
66
71
$ initVectorSize = @mcrypt_enc_get_iv_size ($ this ->_handle );
72
+ // @codingStandardsIgnoreEnd
67
73
if (true === $ initVector ) {
68
74
/* Generate a random vector from human-readable characters */
69
75
$ abc = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ' ;
@@ -84,19 +90,27 @@ public function __construct(
84
90
}
85
91
$ this ->_initVector = $ initVector ;
86
92
} catch (\Exception $ e ) {
93
+ // @codingStandardsIgnoreStart
87
94
@mcrypt_module_close ($ this ->_handle );
95
+ // @codingStandardsIgnoreEnd
88
96
throw $ e ;
89
97
}
98
+ // @codingStandardsIgnoreStart
90
99
@mcrypt_generic_init ($ this ->_handle , $ key , $ initVector );
100
+ // @codingStandardsIgnoreEnd
91
101
}
92
102
93
103
/**
94
104
* Destructor frees allocated resources
95
105
*/
96
106
public function __destruct ()
97
107
{
108
+ // @codingStandardsIgnoreStart
98
109
@mcrypt_generic_deinit ($ this ->_handle );
110
+ // @codingStandardsIgnoreEnd
111
+ // @codingStandardsIgnoreStart
99
112
@mcrypt_module_close ($ this ->_handle );
113
+ // @codingStandardsIgnoreEnd
100
114
}
101
115
102
116
/**
@@ -140,7 +154,9 @@ public function encrypt($data)
140
154
if (strlen ($ data ) == 0 ) {
141
155
return $ data ;
142
156
}
157
+ // @codingStandardsIgnoreStart
143
158
return @mcrypt_generic ($ this ->_handle , $ data );
159
+ // @codingStandardsIgnoreEnd
144
160
}
145
161
146
162
/**
@@ -154,7 +170,9 @@ public function decrypt($data)
154
170
if (strlen ($ data ) == 0 ) {
155
171
return $ data ;
156
172
}
173
+ // @codingStandardsIgnoreStart
157
174
$ data = @mdecrypt_generic ($ this ->_handle , $ data );
175
+ // @codingStandardsIgnoreEnd
158
176
/*
159
177
* Returned string can in fact be longer than the unencrypted string due to the padding of the data
160
178
* @link http://www.php.net/manual/en/function.mdecrypt-generic.php
0 commit comments