File tree Expand file tree Collapse file tree 2 files changed +172
-99
lines changed Expand file tree Collapse file tree 2 files changed +172
-99
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,16 @@ class UndefinedMethodException extends Exception {}
132132 */
133133class InvalidLengthException extends Exception {}
134134
135+ /**
136+ * InvalidPaddingException
137+ *
138+ * @author Jim Wigginton <[email protected] > 139+ * @version 0.3.5
140+ * @access public
141+ * @package Crypt_Base
142+ */
143+ class InvalidPaddingException extends Exception {}
144+
135145/**
136146 * Base Class for all Crypt_* cipher classes
137147 *
@@ -141,7 +151,7 @@ class InvalidLengthException extends Exception {}
141151 * @access public
142152 * @package Crypt_Base
143153 */
144- class Crypt_Base {
154+ abstract class Crypt_Base {
145155 /**
146156 * The Encryption Mode
147157 *
@@ -1364,7 +1374,7 @@ function _unpad($text)
13641374 $ length = ord ($ text [strlen ($ text ) - 1 ]);
13651375
13661376 if (!$ length || $ length > $ this ->block_size ) {
1367- return false ;
1377+ throw new InvalidPaddingException ( " An illegal padding character ( $ length ) has been detected " ) ;
13681378 }
13691379
13701380 return substr ($ text , 0 , -$ length );
You can’t perform that action at this time.
0 commit comments