aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controllers/indexController.php2
-rw-r--r--app/Models/EntryDAO.php8
-rw-r--r--app/Models/EntryDAOSQLite.php2
-rw-r--r--lib/lib_rss.php8
4 files changed, 9 insertions, 11 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 1d355ca84..1f49e03ee 100644
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -63,7 +63,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {
FreshRSS_View::prependTitle($title . ' ยท ');
if (FreshRSS_Context::$id_max === '0') {
- FreshRSS_Context::$id_max = time() . '000000';
+ FreshRSS_Context::$id_max = uTimeString();
}
$this->view->callbackBeforeFeeds = static function (FreshRSS_View $view) {
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index f6c327364..f9dc9fd82 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -493,7 +493,7 @@ SQL;
?FreshRSS_BooleanSearch $filters = null, int $state = 0, bool $is_read = true) {
FreshRSS_UserDAO::touch();
if ($idMax == '0') {
- $idMax = time() . '000000';
+ $idMax = uTimeString();
Minz_Log::debug('Calling markReadEntries(0) is deprecated!');
}
@@ -544,7 +544,7 @@ SQL;
public function markReadCat(int $id, string $idMax = '0', ?FreshRSS_BooleanSearch $filters = null, int $state = 0, bool $is_read = true): int|false {
FreshRSS_UserDAO::touch();
if ($idMax == '0') {
- $idMax = time() . '000000';
+ $idMax = uTimeString();
Minz_Log::debug('Calling markReadCat(0) is deprecated!');
}
@@ -585,7 +585,7 @@ SQL;
public function markReadFeed(int $id_feed, string $idMax = '0', ?FreshRSS_BooleanSearch $filters = null, int $state = 0, bool $is_read = true): int|false {
FreshRSS_UserDAO::touch();
if ($idMax == '0') {
- $idMax = time() . '000000';
+ $idMax = uTimeString();
Minz_Log::debug('Calling markReadFeed(0) is deprecated!');
}
$hadTransaction = $this->pdo->inTransaction();
@@ -640,7 +640,7 @@ SQL;
int $state = 0, bool $is_read = true) {
FreshRSS_UserDAO::touch();
if ($idMax == '0') {
- $idMax = time() . '000000';
+ $idMax = uTimeString();
Minz_Log::debug('Calling markReadTag(0) is deprecated!');
}
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 99e216e53..c2470f0d6 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -155,7 +155,7 @@ SQL;
public function markReadTag(int $id = 0, string $idMax = '0', ?FreshRSS_BooleanSearch $filters = null, int $state = 0, bool $is_read = true): int|false {
FreshRSS_UserDAO::touch();
if ($idMax == 0) {
- $idMax = time() . '000000';
+ $idMax = uTimeString();
Minz_Log::debug('Calling markReadTag(0) is deprecated!');
}
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 {