[BUGFIX] DataHandler: cast value to string in checkValueForInput() 60/42260/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Tue, 4 Aug 2015 16:31:50 +0000 (18:31 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Wed, 5 Aug 2015 21:31:34 +0000 (23:31 +0200)
commite4ee3f0b5740684eb14966317b54068c0a306b0d
tree35c7a3f25305d35802ed4ab401934c3311bd6e6b
parentdda6bcea5048f16ef63a3b15c10bb86a6725a4fb
[BUGFIX] DataHandler: cast value to string in checkValueForInput()

Explicitly cast the value as a string before using substr() on it.
Otherwise NULL values would be passed to substr(), resulting in a return
value of FALSE. Without MySQL strict mode this has no direct influence
on the further usage of the value as string as the string representation
of FALSE is an empty string. With MySQL strict mode enabled this leads
to errors upon insertion of records into the database as boolean values
get converted to 0/1 respectively.

Resolves: #68602
Related: #68562
Related: #55082
Releases: master
Change-Id: Idc3ffa147965083492a04b12c64a6c15ddd2277b
Reviewed-on: http://review.typo3.org/42260
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php