From f36574c7a975e93c3a1faf9f3fcace280cda71a8 Mon Sep 17 00:00:00 2001 From: Alexander Stehlik Date: Thu, 15 Aug 2013 18:05:10 +0200 Subject: [PATCH 1/1] [BUGFIX] Fix PHP warning when writing to Backend user log The writelog method for the BackendUserAuthentication object is now checking if there is actually an uid available in the user array before it tries to access it. This prevents a PHP warning about an illegal string offset when writing log messages in an authentication service. Releases: 6.0, 6.1, 6.2 Resolves: #49328 Change-Id: I006c6b0ccd8f03292715a7d7ab8e457914637d93 Reviewed-on: https://review.typo3.org/23116 Reviewed-by: Markus Klein Tested-by: Markus Klein Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- .../Classes/Authentication/BackendUserAuthentication.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php b/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php index 7654da55b048..11b28a37a869 100644 --- a/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php +++ b/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php @@ -2055,8 +2055,12 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU * @todo Define visibility */ public function writelog($type, $action, $error, $details_nr, $details, $data, $tablename = '', $recuid = '', $recpid = '', $event_pid = -1, $NEWid = '', $userId = 0) { + if (!$userId && isset($this->user['uid'])) { + $userId = $this->user['uid']; + } + $fields_values = array( - 'userid' => $userId ? $userId : intval($this->user['uid']), + 'userid' => intval($userId), 'type' => intval($type), 'action' => intval($action), 'error' => intval($error), @@ -2392,4 +2396,4 @@ This is a dump of the failures: } -?> \ No newline at end of file +?> -- 2.20.1