From 9c375e64602b449b02a0eff8355583d530b02cac Mon Sep 17 00:00:00 2001
From: Philipp <admin@philipp.info>
Date: Mon, 3 Apr 2023 18:42:41 +0200
Subject: [PATCH] Fix  DateTimeFormat issue

---
 src/Util/DateTimeFormat.php           | 4 ++--
 tests/src/Util/DateTimeFormatTest.php | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Util/DateTimeFormat.php b/src/Util/DateTimeFormat.php
index df7b6d92c4..e8b3482620 100644
--- a/src/Util/DateTimeFormat.php
+++ b/src/Util/DateTimeFormat.php
@@ -182,8 +182,8 @@ class DateTimeFormat
 	 */
 	public static function fix(string $dateString): string
 	{
-		$search  = ['Mär', 'März', 'Mai', 'Juni', 'Juli', 'Okt', 'Dez', 'ET' , 'ZZ', ' - ', '&#x2B;', '&amp;#43;', ' (Coordinated Universal Time)'];
-		$replace = ['Mar', 'Mar' , 'May', 'Jun' , 'Jul' , 'Oct', 'Dec', 'EST', 'Z' , ', ' , '+'     , '+'        , ''];
+		$search  = ['Mär', 'März', 'Mai', 'Juni', 'Juli', 'Okt', 'Dez', 'ET' , 'ZZ', ' - ', '&#x2B;', '&amp;#43;', ' (Coordinated Universal Time)', '\\'];
+		$replace = ['Mar', 'Mar' , 'May', 'Jun' , 'Jul' , 'Oct', 'Dec', 'EST', 'Z' , ', ' , '+'     , '+'        , ''                             , ''];
 
 		$dateString = str_replace($search, $replace, $dateString);
 
diff --git a/tests/src/Util/DateTimeFormatTest.php b/tests/src/Util/DateTimeFormatTest.php
index c4e2127bad..046680de62 100644
--- a/tests/src/Util/DateTimeFormatTest.php
+++ b/tests/src/Util/DateTimeFormatTest.php
@@ -134,7 +134,11 @@ class DateTimeFormatTest extends MockedTest
 			'Double HTML encode' => [
 				'expectedDate' => '2015-05-22T08:48:00+12:00',
 				'dateString' => '2015-05-22T08:48:00&amp;#43;12:00'
-			]
+			],
+			'2023-04-02\T17:22:42+05:30' => [
+				'expectedDate' => '2023-04-02T17:22:42+05:30',
+				'dateString' => '2023-04-02\T17:22:42+05:30'
+			],
 		];
 	}