]> git.mxchange.org Git - friendica.git/commitdiff
Properly handle feed item creation date with surrounding whitespace
authorDaniel Siepmann <coding@daniel-siepmann.de>
Tue, 17 Jan 2023 06:17:01 +0000 (07:17 +0100)
committerDaniel Siepmann <coding@daniel-siepmann.de>
Tue, 17 Jan 2023 06:18:47 +0000 (07:18 +0100)
Some feeds might have whitespace around the creation date.
This can't be parsed by DateTimeFormat methods.
Therefore the incoming creation date is trimmed to not contain any
surrounding whitespace for proper handling.

Relates: #12686

src/Protocol/Feed.php

index ccbe35e712497188e8ce5b0a44aff11799e10c67..be58b9aa8ffa504cf587bc5059beee990efb0bf7 100644 (file)
@@ -376,11 +376,11 @@ class Feed
                        }
 
                        if ($published != '') {
-                               $item['created'] = $published;
+                               $item['created'] = trim($published);
                        }
 
                        if ($updated != '') {
-                               $item['edited'] = $updated;
+                               $item['edited'] = trim($updated);
                        }
 
                        if (!$dryRun) {