Bug #50868
closedstdWrap.numberFormat (tslib_cObj->numberFormat) fills database table sys_log
100%
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
Updated by Gerrit Code Review over 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22936
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22936
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22936
Updated by Wouter Wolters over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ed8ee7aff16c93d14cfd18c4844a1ed978bb503b.
Updated by Gerrit Code Review over 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22974
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22975
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/22977
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/22978
Updated by Anja Leichsenring over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 380fb859a75aa8d5c14e20c85189e98f333291ae.