Merge branch 'necrox87-patch-1'

This commit is contained in:
SilverFire - Dmitry Naumenko
2016-01-19 00:42:06 +02:00
2 changed files with 4 additions and 8 deletions

View File

@@ -40,6 +40,7 @@ Yii Framework 2 Change Log
- Bug #9984: Fixed wrong captcha color in case Imagick is used (DrDeath72) - Bug #9984: Fixed wrong captcha color in case Imagick is used (DrDeath72)
- Bug #9999: Fixed `yii\web\UrlRule` to allow route parameter names with `-`, `_`, `.`characters (silverfire) - Bug #9999: Fixed `yii\web\UrlRule` to allow route parameter names with `-`, `_`, `.`characters (silverfire)
- Bug #10029: Fixed MaskedInput not working with PJAX (martrix78, samdark) - Bug #10029: Fixed MaskedInput not working with PJAX (martrix78, samdark)
- Bug #10052: Fixed `yii\i18n\Formatter` to work with huge numbers on 32-bit arch (necrox87, silverfire)
- Bug #10101: Fixed assignments saving on role removing in `\yii\rbac\PhpManager` (rezident1307) - Bug #10101: Fixed assignments saving on role removing in `\yii\rbac\PhpManager` (rezident1307)
- Bug #10142: Fixed `yii\validators\EmailValidator` to check the length of email properly (silverfire) - Bug #10142: Fixed `yii\validators\EmailValidator` to check the length of email properly (silverfire)
- Bug #10263: Fixed `yii\validators\UniqueValidator` to work properly when model is not instance of `targetClass` (bupy7, githubjeka, silverfire) - Bug #10263: Fixed `yii\validators\UniqueValidator` to work properly when model is not instance of `targetClass` (bupy7, githubjeka, silverfire)

View File

@@ -1123,7 +1123,7 @@ class Formatter extends Component
* If [[sizeFormatBase]] is 1024, [binary prefixes](http://en.wikipedia.org/wiki/Binary_prefix) (e.g. kibibyte/KiB, mebibyte/MiB, ...) * If [[sizeFormatBase]] is 1024, [binary prefixes](http://en.wikipedia.org/wiki/Binary_prefix) (e.g. kibibyte/KiB, mebibyte/MiB, ...)
* are used in the formatting result. * are used in the formatting result.
* *
* @param integer $value value in bytes to be formatted. * @param string|integer|float $value value in bytes to be formatted.
* @param integer $decimals the number of digits after the decimal point. * @param integer $decimals the number of digits after the decimal point.
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]]. * @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]]. * @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
@@ -1167,7 +1167,7 @@ class Formatter extends Component
* If [[sizeFormatBase]] is 1024, [binary prefixes](http://en.wikipedia.org/wiki/Binary_prefix) (e.g. kibibyte/KiB, mebibyte/MiB, ...) * If [[sizeFormatBase]] is 1024, [binary prefixes](http://en.wikipedia.org/wiki/Binary_prefix) (e.g. kibibyte/KiB, mebibyte/MiB, ...)
* are used in the formatting result. * are used in the formatting result.
* *
* @param integer $value value in bytes to be formatted. * @param string|integer|float $value value in bytes to be formatted.
* @param integer $decimals the number of digits after the decimal point. * @param integer $decimals the number of digits after the decimal point.
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]]. * @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]]. * @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
@@ -1218,12 +1218,7 @@ class Formatter extends Component
*/ */
private function formatSizeNumber($value, $decimals, $options, $textOptions) private function formatSizeNumber($value, $decimals, $options, $textOptions)
{ {
if (is_string($value) && is_numeric($value)) { $value = $this->normalizeNumericValue($value);
$value = (int) $value;
}
if (!is_numeric($value)) {
throw new InvalidParamException("'$value' is not a numeric value.");
}
$position = 0; $position = 0;
do { do {