aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.fr.md12
-rw-r--r--README.md12
-rw-r--r--app/Controllers/indexController.php3
-rw-r--r--app/Models/Context.php4
-rw-r--r--app/Models/Entry.php15
-rw-r--r--app/Models/EntryDAO.php31
-rw-r--r--app/Models/UserConfiguration.php2
-rw-r--r--app/i18n/cs/index.php2
-rw-r--r--app/i18n/de/index.php2
-rw-r--r--app/i18n/el/index.php2
-rw-r--r--app/i18n/en-US/index.php2
-rw-r--r--app/i18n/en/index.php2
-rw-r--r--app/i18n/es/index.php2
-rw-r--r--app/i18n/fa/index.php2
-rw-r--r--app/i18n/fi/index.php2
-rw-r--r--app/i18n/fr/index.php2
-rw-r--r--app/i18n/he/index.php2
-rw-r--r--app/i18n/hu/index.php2
-rw-r--r--app/i18n/id/index.php2
-rw-r--r--app/i18n/it/index.php2
-rw-r--r--app/i18n/ja/index.php2
-rw-r--r--app/i18n/ko/index.php2
-rw-r--r--app/i18n/lv/index.php2
-rw-r--r--app/i18n/nl/index.php2
-rw-r--r--app/i18n/oc/index.php2
-rw-r--r--app/i18n/pl/index.php2
-rw-r--r--app/i18n/pt-BR/index.php2
-rw-r--r--app/i18n/pt-PT/index.php2
-rw-r--r--app/i18n/ru/index.php2
-rw-r--r--app/i18n/sk/index.php2
-rw-r--r--app/i18n/tr/index.php2
-rw-r--r--app/i18n/uk/index.php2
-rw-r--r--app/i18n/zh-CN/index.php2
-rw-r--r--app/i18n/zh-TW/index.php2
-rw-r--r--app/layout/nav_menu.phtml4
35 files changed, 108 insertions, 29 deletions
diff --git a/README.fr.md b/README.fr.md
index 7e96a0685..fced3b8ed 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -226,13 +226,13 @@ Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensio
| Langage | Progression | |
| - | - | - |
-| Čeština (cs) | ■■■■■■■■・・ 86% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fcs+%2F%28TODO%7CDIRTY%29%24%2F) |
+| Čeština (cs) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fcs+%2F%28TODO%7CDIRTY%29%24%2F) |
| Deutsch (de) | ■■■■■■■■■・ 96% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fde+%2F%28TODO%7CDIRTY%29%24%2F) |
| Ελληνικά (el) | ■■・・・・・・・・ 22% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fel+%2F%28TODO%7CDIRTY%29%24%2F) |
| English (en) | ■■■■■■■■■■ 100% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fen+%2F%28TODO%7CDIRTY%29%24%2F) |
| English (United States) (en-US) | ■■■■■■■■■■ 100% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fen-US+%2F%28TODO%7CDIRTY%29%24%2F) |
| Español (es) | ■■■■■■■■・・ 89% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fes+%2F%28TODO%7CDIRTY%29%24%2F) |
-| فارسی (fa) | ■■■■■■■■■・ 95% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffa+%2F%28TODO%7CDIRTY%29%24%2F) |
+| فارسی (fa) | ■■■■■■■■■・ 94% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffa+%2F%28TODO%7CDIRTY%29%24%2F) |
| Suomi (fi) | ■■■■■■■■■・ 97% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffi+%2F%28TODO%7CDIRTY%29%24%2F) |
| Français (fr) | ■■■■■■■■■■ 100% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffr+%2F%28TODO%7CDIRTY%29%24%2F) |
| עברית (he) | ■■■■・・・・・・ 44% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhe+%2F%28TODO%7CDIRTY%29%24%2F) |
@@ -240,19 +240,19 @@ Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensio
| Bahasa Indonesia (id) | ■■■■■■■■■・ 94% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) |
| Italiano (it) | ■■■■■■■■■・ 97% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) |
| 日本語 (ja) | ■■■■■■■■■・ 92% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fja+%2F%28TODO%7CDIRTY%29%24%2F) |
-| 한국어 (ko) | ■■■■■■■■・・ 86% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) |
+| 한국어 (ko) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) |
| Latviešu (lv) | ■■■■■■■■・・ 80% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Flv+%2F%28TODO%7CDIRTY%29%24%2F) |
| Nederlands (nl) | ■■■■■■■■■・ 96% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fnl+%2F%28TODO%7CDIRTY%29%24%2F) |
| Occitan (oc) | ■■■■■■■・・・ 78% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Foc+%2F%28TODO%7CDIRTY%29%24%2F) |
| Polski (pl) | ■■■■■■■■■・ 97% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpl+%2F%28TODO%7CDIRTY%29%24%2F) |
| Português (Brasil) (pt-BR) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-BR+%2F%28TODO%7CDIRTY%29%24%2F) |
| Português (Portugal) (pt-PT) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-PT+%2F%28TODO%7CDIRTY%29%24%2F) |
-| Русский (ru) | ■■■■■■■■・・ 86% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fru+%2F%28TODO%7CDIRTY%29%24%2F) |
-| Slovenčina (sk) | ■■■■■■■■・・ 86% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |
+| Русский (ru) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fru+%2F%28TODO%7CDIRTY%29%24%2F) |
+| Slovenčina (sk) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |
| Türkçe (tr) | ■■■■■■■■■・ 93% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ftr+%2F%28TODO%7CDIRTY%29%24%2F) |
| Українська (uk) | ■■■■■■■■■・ 96% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fuk+%2F%28TODO%7CDIRTY%29%24%2F) |
| 简体中文 (zh-CN) | ■■■■■■■■・・ 87% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-CN+%2F%28TODO%7CDIRTY%29%24%2F) |
-| 正體中文 (zh-TW) | ■■■■■■■■・・ 86% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-TW+%2F%28TODO%7CDIRTY%29%24%2F) |
+| 正體中文 (zh-TW) | ■■■■■■■■・・ 85% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-TW+%2F%28TODO%7CDIRTY%29%24%2F) |
</translations>
diff --git a/README.md b/README.md
index ca7405dd1..27430383a 100644
--- a/README.md
+++ b/README.md
@@ -122,13 +122,13 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E
| Language | Progress | |
| - | - | - |
-| Čeština (cs) | ■■■■■■■■・・ 86% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fcs+%2F%28TODO%7CDIRTY%29%24%2F) |
+| Čeština (cs) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fcs+%2F%28TODO%7CDIRTY%29%24%2F) |
| Deutsch (de) | ■■■■■■■■■・ 96% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fde+%2F%28TODO%7CDIRTY%29%24%2F) |
| Ελληνικά (el) | ■■・・・・・・・・ 22% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fel+%2F%28TODO%7CDIRTY%29%24%2F) |
| English (en) | ■■■■■■■■■■ 100% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fen+%2F%28TODO%7CDIRTY%29%24%2F) |
| English (United States) (en-US) | ■■■■■■■■■■ 100% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fen-US+%2F%28TODO%7CDIRTY%29%24%2F) |
| Español (es) | ■■■■■■■■・・ 89% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fes+%2F%28TODO%7CDIRTY%29%24%2F) |
-| فارسی (fa) | ■■■■■■■■■・ 95% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffa+%2F%28TODO%7CDIRTY%29%24%2F) |
+| فارسی (fa) | ■■■■■■■■■・ 94% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffa+%2F%28TODO%7CDIRTY%29%24%2F) |
| Suomi (fi) | ■■■■■■■■■・ 97% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffi+%2F%28TODO%7CDIRTY%29%24%2F) |
| Français (fr) | ■■■■■■■■■■ 100% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffr+%2F%28TODO%7CDIRTY%29%24%2F) |
| עברית (he) | ■■■■・・・・・・ 44% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhe+%2F%28TODO%7CDIRTY%29%24%2F) |
@@ -136,19 +136,19 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E
| Bahasa Indonesia (id) | ■■■■■■■■■・ 94% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) |
| Italiano (it) | ■■■■■■■■■・ 97% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) |
| 日本語 (ja) | ■■■■■■■■■・ 92% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fja+%2F%28TODO%7CDIRTY%29%24%2F) |
-| 한국어 (ko) | ■■■■■■■■・・ 86% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) |
+| 한국어 (ko) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) |
| Latviešu (lv) | ■■■■■■■■・・ 80% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Flv+%2F%28TODO%7CDIRTY%29%24%2F) |
| Nederlands (nl) | ■■■■■■■■■・ 96% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fnl+%2F%28TODO%7CDIRTY%29%24%2F) |
| Occitan (oc) | ■■■■■■■・・・ 78% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Foc+%2F%28TODO%7CDIRTY%29%24%2F) |
| Polski (pl) | ■■■■■■■■■・ 97% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpl+%2F%28TODO%7CDIRTY%29%24%2F) |
| Português (Brasil) (pt-BR) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-BR+%2F%28TODO%7CDIRTY%29%24%2F) |
| Português (Portugal) (pt-PT) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-PT+%2F%28TODO%7CDIRTY%29%24%2F) |
-| Русский (ru) | ■■■■■■■■・・ 86% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fru+%2F%28TODO%7CDIRTY%29%24%2F) |
-| Slovenčina (sk) | ■■■■■■■■・・ 86% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |
+| Русский (ru) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fru+%2F%28TODO%7CDIRTY%29%24%2F) |
+| Slovenčina (sk) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |
| Türkçe (tr) | ■■■■■■■■■・ 93% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ftr+%2F%28TODO%7CDIRTY%29%24%2F) |
| Українська (uk) | ■■■■■■■■■・ 96% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fuk+%2F%28TODO%7CDIRTY%29%24%2F) |
| 简体中文 (zh-CN) | ■■■■■■■■・・ 87% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-CN+%2F%28TODO%7CDIRTY%29%24%2F) |
-| 正體中文 (zh-TW) | ■■■■■■■■・・ 86% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-TW+%2F%28TODO%7CDIRTY%29%24%2F) |
+| 正體中文 (zh-TW) | ■■■■■■■■・・ 85% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-TW+%2F%28TODO%7CDIRTY%29%24%2F) |
</translations>
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 405c7c5a8..8043e8f79 100644
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -285,7 +285,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {
$continuation_values = [];
if (FreshRSS_Context::$continuation_id !== '0') {
- if (in_array(FreshRSS_Context::$sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified'], true)) {
+ if (in_array(FreshRSS_Context::$sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified', 'length'], true)) {
$pagingEntry = $entryDAO->searchById(FreshRSS_Context::$continuation_id);
if ($pagingEntry !== null && in_array(FreshRSS_Context::$sort, ['c.name', 'f.name'], true)) {
@@ -303,6 +303,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {
'link' => $pagingEntry->link(true),
'title' => $pagingEntry->title(),
'lastUserModified' => $pagingEntry->lastUserModified(),
+ 'length' => $pagingEntry->sqlContentLength() ?? 0,
};
if ($pagingEntry !== null && FreshRSS_Context::$sort === 'c.name') {
// Secondary sort criterion
diff --git a/app/Models/Context.php b/app/Models/Context.php
index c0e25dffd..8cd78c779 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -42,7 +42,7 @@ final class FreshRSS_Context {
public static int $state = 0;
/** @var 'ASC'|'DESC' */
public static string $order = 'DESC';
- /** @var 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified' */
+ /** @var 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified'|'length' */
public static string $sort = 'id';
public static int $number = 0;
public static int $offset = 0;
@@ -252,7 +252,7 @@ final class FreshRSS_Context {
$order = Minz_Request::paramString('order', true) ?: FreshRSS_Context::userConf()->sort_order;
self::$order = in_array($order, ['ASC', 'DESC'], true) ? $order : 'DESC';
$sort = Minz_Request::paramString('sort', true) ?: FreshRSS_Context::userConf()->sort;
- self::$sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified'], true) ? $sort : 'id';
+ self::$sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified', 'length'], true) ? $sort : 'id';
self::$number = Minz_Request::paramInt('nb') ?: FreshRSS_Context::userConf()->posts_per_page;
if (self::$number > FreshRSS_Context::userConf()->max_posts_per_rss) {
self::$number = max(
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 296c3860f..ea124794a 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -28,6 +28,7 @@ class FreshRSS_Entry extends Minz_Model {
/** In microseconds */
private string $date_added = '0';
private string $hash = '';
+ private ?int $sqlContentLength = null;
private ?bool $is_read;
private ?bool $is_favorite;
private bool $is_updated = false;
@@ -56,7 +57,8 @@ class FreshRSS_Entry extends Minz_Model {
/** @param array{id?:string,id_feed?:int,guid?:string,title?:string,author?:string,content?:string,link?:string,
* date?:int|string,lastSeen?:int,lastUserModified?:int,
- * hash?:string,is_read?:bool|int,is_favorite?:bool|int,tags?:string|array<string>,attributes?:?string,thumbnail?:string,timestamp?:string} $dao */
+ * hash?:string,is_read?:bool|int,is_favorite?:bool|int,tags?:string|array<string>,attributes?:?string,thumbnail?:string,timestamp?:string,
+ * content_length?:int} $dao */
public static function fromArray(array $dao): FreshRSS_Entry {
if (empty($dao['content']) || !is_string($dao['content'])) {
$dao['content'] = '';
@@ -108,6 +110,9 @@ class FreshRSS_Entry extends Minz_Model {
if (!empty($dao['hash'])) {
$entry->_hash($dao['hash']);
}
+ if (isset($dao['content_length']) && is_numeric($dao['content_length'])) {
+ $entry->_sqlContentLength((int)$dao['content_length']);
+ }
return $entry;
}
@@ -500,6 +505,10 @@ HTML;
return $this->hash;
}
+ public function sqlContentLength(): ?int {
+ return $this->sqlContentLength;
+ }
+
public function _hash(string $value): string {
$value = trim($value);
if (ctype_xdigit($value)) {
@@ -508,6 +517,10 @@ HTML;
return $this->hash;
}
+ public function _sqlContentLength(int $value): void {
+ $this->sqlContentLength = $value > 0 ? $value : null;
+ }
+
/** @param int|numeric-string $value String is for compatibility with 32-bit platforms */
public function _id(int|string $value): void {
if (is_int($value)) {
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index c9fae7923..0d34df3ac 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -812,27 +812,31 @@ SQL;
public function searchByGuid(int $id_feed, string $guid): ?FreshRSS_Entry {
$content = static::isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content';
+ $contentLength = 'LENGTH(' . (static::isCompressed() ? 'content_bin' : 'content') . ') AS content_length';
$hash = static::sqlHexEncode('hash');
$sql = <<<SQL
-SELECT id, guid, title, author, {$content}, link, date, `lastSeen`, `lastUserModified`, {$hash} AS hash, is_read, is_favorite, id_feed, tags, attributes
+SELECT id, guid, title, author, {$content}, link, date, `lastSeen`, `lastUserModified`, {$hash} AS hash, is_read, is_favorite, id_feed, tags, attributes,
+ {$contentLength}
FROM `_entry` WHERE id_feed=:id_feed AND guid=:guid
SQL;
$res = $this->fetchAssoc($sql, [':id_feed' => $id_feed, ':guid' => $guid]);
/** @var list<array{id:string,id_feed:int,guid:string,title:string,author:string,content:string,link:string,date:int,
- * is_read:int,is_favorite:int,tags:string,attributes:?string}> $res */
+ * is_read:int,is_favorite:int,tags:string,attributes:?string,content_length:int}> $res */
return isset($res[0]) ? FreshRSS_Entry::fromArray($res[0]) : null;
}
public function searchById(string $id): ?FreshRSS_Entry {
$content = static::isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content';
+ $contentLength = 'LENGTH(' . (static::isCompressed() ? 'content_bin' : 'content') . ') AS content_length';
$hash = static::sqlHexEncode('hash');
$sql = <<<SQL
-SELECT id, guid, title, author, {$content}, link, date, `lastSeen`, `lastUserModified`, {$hash} AS hash, is_read, is_favorite, id_feed, tags, attributes
+SELECT id, guid, title, author, {$content}, link, date, `lastSeen`, `lastUserModified`, {$hash} AS hash, is_read, is_favorite, id_feed, tags, attributes,
+ {$contentLength}
FROM `_entry` WHERE id=:id
SQL;
$res = $this->fetchAssoc($sql, [':id' => $id]);
- /** @var list<array{'id':string,'id_feed':int,'guid':string,'title':string,'author':string,'content':string,'link':string,'date':int,
- * 'is_read':int,'is_favorite':int,'tags':string,'attributes':?string}> $res */
+ /** @var list<array{id:string,id_feed:int,guid:string,title:string,author:string,content:string,link:string,date:int,
+ * is_read:int,is_favorite:int,tags:string,attributes:?string,content_length:int}> $res */
return isset($res[0]) ? FreshRSS_Entry::fromArray($res[0]) : null;
}
@@ -1256,7 +1260,7 @@ SQL;
/**
* @param numeric-string $id_min
* @param numeric-string $id_max
- * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified' $sort
+ * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified'|'length' $sort
* @param 'ASC'|'DESC' $order
* @param numeric-string $continuation_id
* @param list<string|int> $continuation_values
@@ -1324,12 +1328,13 @@ SQL;
$values[] = $id_min;
}
- if ($continuation_id !== '0' && in_array($sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified'], true)) {
+ if ($continuation_id !== '0' && in_array($sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified', 'length'], true)) {
$sign = $order === 'ASC' ? '>' : '<';
$orderBy = match ($sort) {
'c.name' => 'c.name',
'f.name' => 'f.name',
'lastUserModified' => $alias . '`lastUserModified`',
+ 'length' => 'LENGTH(' . $alias . (static::isCompressed() ? 'content_bin' : 'content') . ')',
default => $alias . $sort,
};
// Keyset pagination (Compatibility syntax due to poor performance of tuple syntax in MySQL https://bugs.mysql.com/bug.php?id=104128)
@@ -1367,7 +1372,7 @@ SQL;
* @param int $id category/feed/tag ID
* @param numeric-string $id_min
* @param numeric-string $id_max
- * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified' $sort
+ * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified'|'length' $sort
* @param 'ASC'|'DESC' $order
* @param numeric-string $continuation_id
* @param list<string|int> $continuation_values
@@ -1426,11 +1431,12 @@ SQL;
}
$order = in_array($order, ['ASC', 'DESC'], true) ? $order : 'DESC';
- $sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified'], true) ? $sort : 'id';
+ $sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified', 'length'], true) ? $sort : 'id';
$orderBy = match ($sort) {
'c.name' => 'c.name',
'f.name' => 'f.name',
'lastUserModified' => 'e.`lastUserModified`',
+ 'length' => 'LENGTH(e.' . (static::isCompressed() ? 'content_bin' : 'content') . ')',
'rand' => static::sqlRandom(),
default => 'e.' . $sort,
};
@@ -1460,7 +1466,7 @@ SQL;
* @param int $id category/feed/tag ID
* @param numeric-string $id_min
* @param numeric-string $id_max
- * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified' $sort
+ * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified'|'length' $sort
* @param 'ASC'|'DESC' $order
* @param numeric-string $continuation_id
* @param list<string|int> $continuation_values
@@ -1470,7 +1476,7 @@ SQL;
string $id_min = '0', string $id_max = '0', string $sort = 'id', string $order = 'DESC',
string $continuation_id = '0', array $continuation_values = [], int $limit = 1, int $offset = 0): PDOStatement|false {
$order = in_array($order, ['ASC', 'DESC'], true) ? $order : 'DESC';
- $sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified'], true) ? $sort : 'id';
+ $sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified', 'length'], true) ? $sort : 'id';
[$values, $sql] = $this->sqlListWhere($type, $id, $state, $filters, id_min: $id_min, id_max: $id_max, sort: $sort, order: $order,
continuation_id: $continuation_id, continuation_values: $continuation_values, limit: $limit, offset: $offset);
@@ -1479,6 +1485,7 @@ SQL;
'c.name' => 'c0.name',
'f.name' => 'f0.name',
'lastUserModified' => 'e0.`lastUserModified`',
+ 'length' => 'LENGTH(e0.' . (static::isCompressed() ? 'content_bin' : 'content') . ')',
'rand' => static::sqlRandom(),
default => 'e0.' . $sort,
};
@@ -1523,7 +1530,7 @@ SQL;
* @param int $id category/feed/tag ID
* @param numeric-string $id_min
* @param numeric-string $id_max
- * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified' $sort
+ * @param 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified'|'length' $sort
* @param 'ASC'|'DESC' $order
* @param numeric-string $continuation_id
* @param list<string|int> $continuation_values
diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php
index 88263e1ad..eaa08d92d 100644
--- a/app/Models/UserConfiguration.php
+++ b/app/Models/UserConfiguration.php
@@ -55,7 +55,7 @@ declare(strict_types=1);
* @property bool $show_nav_buttons
* @property 'big'|'small'|'none' $mark_read_button
* @property 'ASC'|'DESC' $sort_order
- * @property 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand' $sort
+ * @property 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'length' $sort
* @property array<int,array<string,string>> $sharing
* @property array<string,string> $shortcuts
* @property bool $sides_close_article
diff --git a/app/i18n/cs/index.php b/app/i18n/cs/index.php
index 255f0b18b..18b7fd655 100644
--- a/app/i18n/cs/index.php
+++ b/app/i18n/cs/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/de/index.php b/app/i18n/de/index.php
index f2d3346e3..41c192f71 100644
--- a/app/i18n/de/index.php
+++ b/app/i18n/de/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Älteste zuerst',
'id_desc' => 'Neueste zuerst',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // IGNORE
'link_desc' => 'Link Z→A', // IGNORE
'rand' => 'Zufällige Reihenfolge',
diff --git a/app/i18n/el/index.php b/app/i18n/el/index.php
index 8ac8a4927..251eb9353 100644
--- a/app/i18n/el/index.php
+++ b/app/i18n/el/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/en-US/index.php b/app/i18n/en-US/index.php
index a65b752f7..d112d143e 100644
--- a/app/i18n/en-US/index.php
+++ b/app/i18n/en-US/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // IGNORE
'id_desc' => 'Freshly received first', // IGNORE
+ 'length_asc' => 'Content length 1→9', // IGNORE
+ 'length_desc' => 'Content length 9→1', // IGNORE
'link_asc' => 'Link A→Z', // IGNORE
'link_desc' => 'Link Z→A', // IGNORE
'rand' => 'Random order', // IGNORE
diff --git a/app/i18n/en/index.php b/app/i18n/en/index.php
index 47e89f148..d0a39a7a5 100644
--- a/app/i18n/en/index.php
+++ b/app/i18n/en/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last',
'id_desc' => 'Freshly received first',
+ 'length_asc' => 'Content length 1→9',
+ 'length_desc' => 'Content length 9→1',
'link_asc' => 'Link A→Z',
'link_desc' => 'Link Z→A',
'rand' => 'Random order',
diff --git a/app/i18n/es/index.php b/app/i18n/es/index.php
index 6ace58d64..73a5e3e39 100644
--- a/app/i18n/es/index.php
+++ b/app/i18n/es/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/fa/index.php b/app/i18n/fa/index.php
index 588bfba4b..65f331a5f 100644
--- a/app/i18n/fa/index.php
+++ b/app/i18n/fa/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'آخرین مورد، به تازه گی دریافت شد',
'id_desc' => 'نخستین مورد دریافت‌شده به تازگی',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'لینک A→Z',
'link_desc' => 'لینک Z→A',
'rand' => 'ترتیب تصادفی',
diff --git a/app/i18n/fi/index.php b/app/i18n/fi/index.php
index bcda1b982..311d13077 100644
--- a/app/i18n/fi/index.php
+++ b/app/i18n/fi/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Uusimmat viimeisenä',
'id_desc' => 'Uusimmat ensimmäisenä',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Linkki A→Ö',
'link_desc' => 'Linkki Ö→A',
'rand' => 'Satunnainen järjestys',
diff --git a/app/i18n/fr/index.php b/app/i18n/fr/index.php
index ab7bc08cb..f51a09ba6 100644
--- a/app/i18n/fr/index.php
+++ b/app/i18n/fr/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Reçus récemment en dernier',
'id_desc' => 'Reçus récemment en premier',
+ 'length_asc' => 'Longueur du contenu 1→9',
+ 'length_desc' => 'Longueur du contenu 9→1',
'link_asc' => 'Lien A→Z',
'link_desc' => 'Lien Z→A',
'rand' => 'Ordre aléatoire',
diff --git a/app/i18n/he/index.php b/app/i18n/he/index.php
index 16037eba3..d52319cba 100644
--- a/app/i18n/he/index.php
+++ b/app/i18n/he/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/hu/index.php b/app/i18n/hu/index.php
index 36c945f78..2345f1249 100644
--- a/app/i18n/hu/index.php
+++ b/app/i18n/hu/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Frissen fogadott utoljára',
'id_desc' => 'Frissen fogadott először',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // IGNORE
'link_desc' => 'Link Z→A', // IGNORE
'rand' => 'Véletlen sorrend',
diff --git a/app/i18n/id/index.php b/app/i18n/id/index.php
index 7b14a9ee8..c06292759 100644
--- a/app/i18n/id/index.php
+++ b/app/i18n/id/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Yang baru diterima terakhir',
'id_desc' => 'Yang baru diterima paling awal',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Tautan A→Z',
'link_desc' => 'Tautan Z→A',
'rand' => 'Acak',
diff --git a/app/i18n/it/index.php b/app/i18n/it/index.php
index 12f2a9a72..1c9a3b2f1 100644
--- a/app/i18n/it/index.php
+++ b/app/i18n/it/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Dal meno recente',
'id_desc' => 'Dal più recente',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // IGNORE
'link_desc' => 'Link Z→A', // IGNORE
'rand' => 'Ordine casuale',
diff --git a/app/i18n/ja/index.php b/app/i18n/ja/index.php
index 831029974..a0879d7b8 100644
--- a/app/i18n/ja/index.php
+++ b/app/i18n/ja/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => '新着を最後に並べる',
'id_desc' => '新着を最初に並べる',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'リンクURL順 A→Z',
'link_desc' => 'リンクURL順 Z→A',
'rand' => 'ランダムに並べる',
diff --git a/app/i18n/ko/index.php b/app/i18n/ko/index.php
index c54bbe7c2..bce49f545 100644
--- a/app/i18n/ko/index.php
+++ b/app/i18n/ko/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/lv/index.php b/app/i18n/lv/index.php
index f985e67c3..db22eda5b 100644
--- a/app/i18n/lv/index.php
+++ b/app/i18n/lv/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/nl/index.php b/app/i18n/nl/index.php
index ea7582845..2993a43b6 100644
--- a/app/i18n/nl/index.php
+++ b/app/i18n/nl/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Nieuw ontvangen laatst',
'id_desc' => 'Nieuw ontvangen eerst',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // IGNORE
'link_desc' => 'Link Z→A', // IGNORE
'rand' => 'Willekeurige volgorde',
diff --git a/app/i18n/oc/index.php b/app/i18n/oc/index.php
index dce2e1ac6..8f28b6ca6 100644
--- a/app/i18n/oc/index.php
+++ b/app/i18n/oc/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/pl/index.php b/app/i18n/pl/index.php
index 8cf9d999b..a335a2f22 100644
--- a/app/i18n/pl/index.php
+++ b/app/i18n/pl/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Najpożniej otrzymane',
'id_desc' => 'Najwcześniej otrzymane',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Odnośnik A→Z',
'link_desc' => 'Odnośnik Z→A',
'rand' => 'Losowa kolejność',
diff --git a/app/i18n/pt-BR/index.php b/app/i18n/pt-BR/index.php
index 777e5f895..787dea15d 100644
--- a/app/i18n/pt-BR/index.php
+++ b/app/i18n/pt-BR/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/pt-PT/index.php b/app/i18n/pt-PT/index.php
index c57d6907f..127bef26f 100644
--- a/app/i18n/pt-PT/index.php
+++ b/app/i18n/pt-PT/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/ru/index.php b/app/i18n/ru/index.php
index d341d5712..96d43b733 100644
--- a/app/i18n/ru/index.php
+++ b/app/i18n/ru/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/sk/index.php b/app/i18n/sk/index.php
index 87a352449..d4aa174b1 100644
--- a/app/i18n/sk/index.php
+++ b/app/i18n/sk/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/tr/index.php b/app/i18n/tr/index.php
index 38fc548a9..50b81b517 100644
--- a/app/i18n/tr/index.php
+++ b/app/i18n/tr/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Son alınanlar en sonda',
'id_desc' => 'Son alınanlar başta',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Bağlantı A→Z',
'link_desc' => 'Bağlantı Z→A',
'rand' => 'Rastgele sıralama',
diff --git a/app/i18n/uk/index.php b/app/i18n/uk/index.php
index 533b51b80..0922444a6 100644
--- a/app/i18n/uk/index.php
+++ b/app/i18n/uk/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Спершу найдавніше отримані',
'id_desc' => 'Спершу щойно отримані',
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Посилання А→Я',
'link_desc' => 'Посилання Я→А',
'rand' => 'Довільний порядок',
diff --git a/app/i18n/zh-CN/index.php b/app/i18n/zh-CN/index.php
index 87aaa8399..ae134e954 100644
--- a/app/i18n/zh-CN/index.php
+++ b/app/i18n/zh-CN/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/i18n/zh-TW/index.php b/app/i18n/zh-TW/index.php
index 1a1b52ba4..45bf17c1b 100644
--- a/app/i18n/zh-TW/index.php
+++ b/app/i18n/zh-TW/index.php
@@ -89,6 +89,8 @@ return array(
),
'id_asc' => 'Freshly received last', // TODO
'id_desc' => 'Freshly received first', // TODO
+ 'length_asc' => 'Content length 1→9', // TODO
+ 'length_desc' => 'Content length 9→1', // TODO
'link_asc' => 'Link A→Z', // TODO
'link_desc' => 'Link Z→A', // TODO
'rand' => 'Random order', // TODO
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index f29d0ae00..bf6d331ee 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -235,6 +235,8 @@
<a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'date', 'order' => 'DESC']]) ?>"><?= _t('index.menu.sort.date_desc') ?></a></li>
<li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'DESC' && FreshRSS_Context::$sort === 'lastUserModified' ? 'true' : 'false' ?>">
<a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'lastUserModified', 'order' => 'DESC']]) ?>"><?= _t('index.menu.sort.user_modified_desc') ?></a></li>
+ <li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'DESC' && FreshRSS_Context::$sort === 'length' ? 'true' : 'false' ?>">
+ <a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'length', 'order' => 'DESC']]) ?>"><?= _t('index.menu.sort.length_desc') ?></a></li>
<li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'DESC' && FreshRSS_Context::$sort === 'link' ? 'true' : 'false' ?>">
<a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'link', 'order' => 'DESC']]) ?>"><?= _t('index.menu.sort.link_desc') ?></a></li>
<li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'DESC' && FreshRSS_Context::$sort === 'title' ? 'true' : 'false' ?>">
@@ -251,6 +253,8 @@
<a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'date', 'order' => 'ASC']]) ?>"><?= _t('index.menu.sort.date_asc') ?></a></li>
<li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'ASC' && FreshRSS_Context::$sort === 'lastUserModified' ? 'true' : 'false' ?>">
<a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'lastUserModified', 'order' => 'ASC']]) ?>"><?= _t('index.menu.sort.user_modified_asc') ?></a></li>
+ <li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'ASC' && FreshRSS_Context::$sort === 'length' ? 'true' : 'false' ?>">
+ <a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'length', 'order' => 'ASC']]) ?>"><?= _t('index.menu.sort.length_asc') ?></a></li>
<li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'ASC' && FreshRSS_Context::$sort === 'link' ? 'true' : 'false' ?>">
<a href="<?= Minz_Url::display($url_order, amend: ['params' => ['sort' => 'link', 'order' => 'ASC']]) ?>"><?= _t('index.menu.sort.link_asc') ?></a></li>
<li class="item" role="radio" aria-checked="<?= FreshRSS_Context::$order === 'ASC' && FreshRSS_Context::$sort === 'title' ? 'true' : 'false' ?>">