mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-14 18:23:52 -04:00
Add feed visibility filter to unread dates view (#8489)
* Add feed visibility filter to unread dates view * Date field sanitize
This commit is contained in:
committed by
GitHub
parent
6b5304b825
commit
f17ed2f7c8
@@ -5,6 +5,9 @@ class FreshRSS_StatsDAOSQLite extends FreshRSS_StatsDAO {
|
||||
|
||||
#[\Override]
|
||||
protected function sqlDateToIsoGranularity(string $field, int $precision, string $granularity): string {
|
||||
if (!preg_match('/^[a-zA-Z0-9_.]+$/', $field)) {
|
||||
throw new InvalidArgumentException('Invalid date field!');
|
||||
}
|
||||
$offset = $this->getTimezoneOffset();
|
||||
return match ($granularity) {
|
||||
'day' => "strftime('%Y-%m-%d', ($field / $precision) + $offset, 'unixepoch')",
|
||||
|
||||
Reference in New Issue
Block a user