Browse Source

Fix StringHelper::substr() call.

tags/2.0.0-beta
ekerazha 11 years ago
parent
commit
cb7921b8a5
  1. 4
      framework/yii/helpers/BaseSecurity.php

4
framework/yii/helpers/BaseSecurity.php

@ -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;

Loading…
Cancel
Save