Bug #61123

BELog module error: "vsprintf(): Too few arguments" the second

Added by Thomas Bach almost 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Logging
Target version:
Start date:
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I get many Errors of the following in the Backend:

Core: Error handler (BE): PHP Warning: vsprintf(): Too few arguments in /var/www/sites/muehlhof.ch/httpdocs/cms/typo3_src-6.2.4/typo3/sysext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php line 44

I found #46077 which reported similar errors and has been fixed by patching AbstractExceptionHandler.php

I found a similar line in ErrorHandler.php and by applying the following patch, the errors in the backend disappeared:

--- typo3/sysext/core/Classes/Error/ErrorHandler.php.orig    2014-08-21 17:01:38.173769303 +0200
+++ typo3/sysext/core/Classes/Error/ErrorHandler.php    2014-08-21 16:56:29.819744574 +0200
@@ -182,7 +182,7 @@
                 'action' => 0,
                 'error' => $severity,
                 'details_nr' => 0,
-                'details' => $logMessage,
+                'details' => str_replace('%', '%%', $logMessage),
                 'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'),
                 'tstamp' => $GLOBALS['EXEC_TIME'],
                 'workspace' => $workspace

I'm not that familiar with the typo3-backend so I don't know the exact cause of these errors and wheater this is an appropriate fix for them.


Related issues

Related to TYPO3 Core - Bug #46077: BELog module error: "vsprintf(): Too few arguments" Closed 2013-03-06
Related to TYPO3 Core - Bug #77444: BELog module error: "vsprintf(): Too few arguments" the second Closed 2016-08-08

Associated revisions

Revision ac53b52a (diff)
Added by Mathias Schreiber over 4 years ago

[BUGFIX] Escape vsprintf placeholders properly

Percentage characters were not properly encoded leading
to a warning in the FormatDetailsVH

Resolves: #61123
Releases: master
Change-Id: I052bb5f15036766fb70fa4f875b2899e555ee8fe
Reviewed-on: https://review.typo3.org/44401
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#1 Updated by Mathias Schreiber over 5 years ago

  • Category set to Logging
  • Target version set to 7.4 (Backend)

#2 Updated by Franz Kugelmann about 5 years ago

I can confirm behaviour and fix.
Since here no value is set for database column log_data and thus % will never be replaced with data, escaping the % seems quite a good solution.

We had the % showing up in error messages with encoded url paths.

#3 Updated by Susanne Moog almost 5 years ago

  • Target version changed from 7.4 (Backend) to 7.5

#4 Updated by Benni Mack almost 5 years ago

  • Target version changed from 7.5 to 7 LTS

#5 Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44401

#6 Updated by Mathias Schreiber over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Tilo Baller almost 4 years ago

Can someone please merge this into the 6.2 branch, because it is affected too. Thanks!

#8 Updated by David Bruchmann over 3 years ago

  • % Done changed from 100 to 0
  • TYPO3 Version changed from 6.2 to 7
  • PHP Version changed from 5.3 to 5.6

Getting this Error shown in Version 7.6.15 again, so either the fix got lost somehow or there is another reason.

#9 Updated by Riccardo De Contardi over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF