From 1ee70ea993ac52e2ce854400ee86d956b50f2958 Mon Sep 17 00:00:00 2001 From: Richard Haeser Date: Mon, 11 Feb 2019 20:24:39 +0100 Subject: [PATCH] [BUGFIX] Cast lastMod property to int To prevent type mismatches when using pdo_mysql as the database driver, the data for the lastMod field is cast to an integer. Resolves: #87689 Releases: master, 9.5 Change-Id: I696f62a3b08d464708c9e1ab9edb4c733835f475 Reviewed-on: https://review.typo3.org/59687 Tested-by: TYPO3com Reviewed-by: Georg Ringer Tested-by: Georg Ringer --- .../seo/Classes/XmlSitemap/AbstractXmlSitemapDataProvider.php | 2 +- .../seo/Classes/XmlSitemap/RecordsXmlSitemapDataProvider.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/seo/Classes/XmlSitemap/AbstractXmlSitemapDataProvider.php b/typo3/sysext/seo/Classes/XmlSitemap/AbstractXmlSitemapDataProvider.php index 70cd3aaf3047..985ca20061ca 100644 --- a/typo3/sysext/seo/Classes/XmlSitemap/AbstractXmlSitemapDataProvider.php +++ b/typo3/sysext/seo/Classes/XmlSitemap/AbstractXmlSitemapDataProvider.php @@ -104,7 +104,7 @@ public function getLastModified(): int $lastMod = 0; foreach ($this->items as $item) { if ((int)$item['lastMod'] > $lastMod) { - $lastMod = $item['lastMod']; + $lastMod = (int)$item['lastMod']; } } diff --git a/typo3/sysext/seo/Classes/XmlSitemap/RecordsXmlSitemapDataProvider.php b/typo3/sysext/seo/Classes/XmlSitemap/RecordsXmlSitemapDataProvider.php index b0e4fab06ac2..0b79dcd87137 100644 --- a/typo3/sysext/seo/Classes/XmlSitemap/RecordsXmlSitemapDataProvider.php +++ b/typo3/sysext/seo/Classes/XmlSitemap/RecordsXmlSitemapDataProvider.php @@ -99,7 +99,7 @@ public function generateItems(): void foreach ($rows as $row) { $this->items[] = [ 'data' => $row, - 'lastMod' => $row[$lastModifiedField] + 'lastMod' => (int)$row[$lastModifiedField] ]; } }