aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-02-01 00:03:51 +0100
committerGravatar GitHub <noreply@github.com> 2022-02-01 00:03:51 +0100
commit05ca0517bbcc782a45692dcde0f9258d3165f6bc (patch)
tree7cbe3879f3a9b04c03ce339a9a1586b2cf2c8f7a /app
parent513f7aaa1651ffcc051d5ba36b6780154b20660d (diff)
Compat import JSON milliseconds (#4186)
#fix https://github.com/FreshRSS/FreshRSS/issues/4185
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/importExportController.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php
index dfe6f97cb..8b2b9cf27 100644
--- a/app/Controllers/importExportController.php
+++ b/app/Controllers/importExportController.php
@@ -409,16 +409,19 @@ class FreshRSS_importExport_Controller extends FreshRSS_ActionController {
$content = sanitizeHTML($content, $url);
if (!empty($item['published'])) {
- $published = $item['published'];
+ $published = '' . $item['published'];
} elseif (!empty($item['timestampUsec'])) {
- $published = substr($item['timestampUsec'], 0, -6);
+ $published = substr('' . $item['timestampUsec'], 0, -6);
} elseif (!empty($item['updated'])) {
- $published = $item['updated'];
+ $published = '' . $item['updated'];
} else {
- $published = 0;
+ $published = '0';
}
- if (!ctype_digit('' . $published)) {
- $published = strtotime($published);
+ if (!ctype_digit($published)) {
+ $published = '' . strtotime($published);
+ }
+ if (strlen($published) > 10) { // Milliseconds, e.g. Feedly
+ $published = substr($published, 0, -3);
}
$entry = new FreshRSS_Entry(