From 1fe9d0e21acd51f54a7ab768bc1cbd742a8b7e3f Mon Sep 17 00:00:00 2001
From: Claus Due <claus@namelesscoder.net>
Date: Sun, 26 Jan 2020 23:51:47 +0100
Subject: [PATCH] [BUGFIX] Avoid PHP fatal error if colPos is not string

The newly added class \TYPO3\CMS\Backend\View\PageLayoutViewDrawEmptyColposContent
incorrectly assumes that colPos values are always strings
when they may very well be integers. This patch casts
the possibly-integer value to string before use of trim().

Releases: master
Resolves: #90211
Change-Id: I8fb145c76f2bd6b0bca187be3b4c5b05fd3c3d80
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63044
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
---
 .../Classes/View/PageLayoutViewDrawEmptyColposContent.php       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Classes/View/PageLayoutViewDrawEmptyColposContent.php b/typo3/sysext/backend/Classes/View/PageLayoutViewDrawEmptyColposContent.php
index 681d0f41deec..cc461f6f338a 100644
--- a/typo3/sysext/backend/Classes/View/PageLayoutViewDrawEmptyColposContent.php
+++ b/typo3/sysext/backend/Classes/View/PageLayoutViewDrawEmptyColposContent.php
@@ -26,7 +26,7 @@ class PageLayoutViewDrawEmptyColposContent
     {
         if (
             !isset($event->getColumnConfig()['colPos'])
-            || trim($event->getColumnConfig()['colPos']) === ''
+            || trim((string)$event->getColumnConfig()['colPos']) === ''
         ) {
             $content = $event->getContent();
             $content .= <<<EOD
-- 
GitLab