Commit cb7921b8 by ekerazha

Fix StringHelper::substr() call.

parent 6dc69e68
...@@ -104,10 +104,10 @@ class BaseSecurity ...@@ -104,10 +104,10 @@ class BaseSecurity
*/ */
protected static function stripPadding($data) protected static function stripPadding($data)
{ {
$end = StringHelper::substr($data, -1); $end = StringHelper::substr($data, -1, NULL);
$last = ord($end); $last = ord($end);
$n = StringHelper::strlen($data) - $last; $n = StringHelper::strlen($data) - $last;
if (StringHelper::substr($data, $n) == str_repeat($end, $last)) { if (StringHelper::substr($data, $n, NULL) == str_repeat($end, $last)) {
return StringHelper::substr($data, 0, $n); return StringHelper::substr($data, 0, $n);
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment