[BUGFIX] Fix PHP warning with date function in FormEngine 61/33661/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 24 Oct 2014 09:49:50 +0000 (11:49 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Fri, 31 Oct 2014 09:02:00 +0000 (10:02 +0100)
commit6bbb0d9857317ac5c14d607017ec10f5c7d84f75
tree032c2f257104409f6de41c8267be49beee16b399
parentc43f00293a191b7ac08956b46719637bdd28b395
[BUGFIX] Fix PHP warning with date function in FormEngine

The timestamp handed to the date function must be of type int
otherwise a warning is issued. Cast the value to int before
passing it to the date function. The important scenarios are
when the timestamp is "0" or "" (blank string).

Add unit test for formatValue function and the possible format
configurations.

Resolves: #62032
Releases: master, 6.2, 6.1, 4.5
Change-Id: I5207ef5b562dd70b9b5e574eef1b9ee59fa836f0
Reviewed-on: http://review.typo3.org/33661
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Tests/Unit/Form/FormEngineTest.php [new file with mode: 0644]