[BUGFIX] BELog module error: "vsprintf(): Too few arguments" 67/19067/2
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Wed, 6 Mar 2013 19:05:01 +0000 (23:05 +0400)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 19 Mar 2013 19:59:59 +0000 (20:59 +0100)
AbstractExceptionHandler contains a function named writeLog. That
function adds an entry to the system log. System log expects not
just a string but a string format with % characters. Callers of
this methods may supply a URL ("Request URL:" in the log message)
that contains % characters. vsprintf() in the BELog view helper
will complain about missing arguments to such string.

Change-Id: Ie080c0af1d93c28f8521b670a8ae8e63f8c4cfda
Resolves: #46077
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/19067
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Error/AbstractExceptionHandler.php

index 024741f..64ee9a7 100644 (file)
@@ -117,7 +117,7 @@ abstract class AbstractExceptionHandler implements \TYPO3\CMS\Core\Error\Excepti
                                'action' => 0,
                                'error' => 2,
                                'details_nr' => 0,
-                               'details' => $logMessage,
+                               'details' => str_replace('%', '%%', $logMessage),
                                'IP' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'),
                                'tstamp' => $GLOBALS['EXEC_TIME'],
                                'workspace' => $workspace
@@ -149,4 +149,4 @@ abstract class AbstractExceptionHandler implements \TYPO3\CMS\Core\Error\Excepti
 }
 
 
-?>
\ No newline at end of file
+?>