From 532d229d3396817f702c1ecae79fb7f9bdad9a64 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 10 May 2025 23:17:25 +0200 Subject: Fix newest articles not shown (#7577) * Fix newest articles not shown Case when processing was faster than 1 second. fix https://github.com/FreshRSS/FreshRSS/issues/7412 Regression from https://github.com/FreshRSS/FreshRSS/pull/7149 * Simplify uTimeString() PHPStan has become a bit smarter --- lib/lib_rss.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 3ddda1515..682b1365d 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -647,11 +647,9 @@ function lazyimg(string $content): string { /** @return numeric-string */ function uTimeString(): string { - $t = @gettimeofday(); - $sec = is_numeric($t['sec']) ? (int)$t['sec'] : 0; - $usec = is_numeric($t['usec']) ? (int)$t['usec'] : 0; - $result = ((string)$sec) . str_pad((string)$usec, 6, '0', STR_PAD_LEFT); - return ctype_digit($result) ? $result : '0'; + $t = gettimeofday(); + // @phpstan-ignore return.type + return ((string)$t['sec']) . str_pad((string)$t['usec'], 6, '0', STR_PAD_LEFT); } function invalidateHttpCache(string $username = ''): bool { -- cgit v1.2.3