[BUGFIX] Avoid DB error on writing to log 57/32257/2
authorMarkus Klein <klein.t3@reelworx.at>
Tue, 19 Aug 2014 13:10:33 +0000 (15:10 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 20 Aug 2014 08:17:38 +0000 (10:17 +0200)
The writeLog() function of the ErrorHandler tries to log the IP that
caused the error. On CLI there is no IP hence a NULL value is being
tried to insert into the DB, where the DB field is NOT NULL.

Fix this by casting the IP to a string.

Resolves: #61051
Releases: 6.3, 6.2
Change-Id: Id46e97468bf825307258e907811d5f2c77c62161
Reviewed-on: http://review.typo3.org/32257
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Error/ErrorHandler.php

index eacda71..9244253 100644 (file)
@@ -183,7 +183,7 @@ class ErrorHandler implements \TYPO3\CMS\Core\Error\ErrorHandlerInterface {
                                'error' => $severity,
                                'details_nr' => 0,
                                'details' => $logMessage,
-                               'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'),
+                               'IP' => (string)GeneralUtility::getIndpEnv('REMOTE_ADDR'),
                                'tstamp' => $GLOBALS['EXEC_TIME'],
                                'workspace' => $workspace
                        );