From: Alexander Stehlik Date: Thu, 15 Aug 2013 16:05:10 +0000 (+0200) Subject: [BUGFIX] Fix PHP warning when writing to Backend user log X-Git-Tag: TYPO3_6-2-0alpha3~56 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/f36574c7a975e93c3a1faf9f3fcace280cda71a8?hp=807b591916c22cb7703f00ff27d330232bfa204e [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 --- 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 +?>