#50868stdWrap.numberFormat (tslib_cObj->numberFormat) fills database table sys_log
Description
I am using the stdWrap.numberFormat very often. But it has a negative impact on my databases.
Every time i use the feature a sys_log entry is created:
Core: Error handler (FE): PHP Warning: number_format() expects parameter 1 to be double, string given in typo3/sysext/cms/tslib/class.tslib_content.php line 4353
PHP expects the first parameter to be float but the main stdWrap function always passes a string value for the $content variable.
It would be very easy to correct this bug by changing one line:
--- typo3/sysext/cms/tslib/class.tslib_content.php
+++ typo3/sysext/cms/tslib/class.tslib_content.php
@@ -4343,12 +4343,12 @@ class tslib_cObj
function numberFormat($content, $conf) {
$decimals = isset($conf['decimals.'])
? $this->stdWrap($conf['decimals'], $conf['decimals.'])
: $conf['decimals'];
$dec_point = isset($conf['dec_point.'])
? $this->stdWrap($conf['dec_point'], $conf['dec_point.'])
: $conf['dec_point'];
$thousands_sep = isset($conf['thousands_sep.'])
? $this->stdWrap($conf['thousands_sep'], $conf['thousands_sep.'])
: $conf['thousands_sep'];
- return number_format($content, $decimals, $dec_point, $thousands_sep);
+ return number_format(floatval($content), $decimals, $dec_point, $thousands_sep);
}
best regards
Christian
Reviews 5
- TYPO3_4-5 22978[BUGFIX] number_format() expects parameter 1 to be double
- TYPO3_4-7 22977[BUGFIX] number_format() expects parameter 1 to be double
- TYPO3_6-0 22975[BUGFIX] number_format() expects parameter 1 to be double
- main 22936[BUGFIX] number_format() expects parameter 1 to be double
- TYPO3_6-1 22974[BUGFIX] number_format() expects parameter 1 to be double