Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/edge' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
math-GH committed Jun 10, 2024
2 parents 4648c1f + 5b28a35 commit be67f09
Show file tree
Hide file tree
Showing 182 changed files with 1,622 additions and 1,070 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.20

ENV TZ UTC
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
Expand Down
2 changes: 1 addition & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extend-exclude = [
"*.pot",
"*.rtl.css",
".git/",
"app/i18n/cz/",
"app/i18n/cs/",
"app/i18n/de/",
"app/i18n/el/",
"app/i18n/es/",
Expand Down
38 changes: 32 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
# FreshRSS changelog

## 2024-05-XX FreshRSS 1.23.2-dev
## 2024-XX-XX FreshRSS 1.24.2-dev


## 2024-06-05 FreshRSS 1.24.1

* Features
* New button to export OMPL of a category [#6519](https://github.com/FreshRSS/FreshRSS/pull/6519)
* Better git error messages in built-in Web update [#6496](https://github.com/FreshRSS/FreshRSS/pull/6496)
* Bug fixing
* Fix regression HTTP GET curl options [#6492](https://github.com/FreshRSS/FreshRSS/pull/6492)
* Fix regression of *mark as read if an identical title already exists* [#6536](https://github.com/FreshRSS/FreshRSS/pull/6536), [#6543](https://github.com/FreshRSS/FreshRSS/pull/6543)
* Fix connection to PostgreSQL databases with uppercase letters [#6482](https://github.com/FreshRSS/FreshRSS/pull/6482)
* Fix UI regression hover over title while having the navigation buttons in mobile view [#6486](https://github.com/FreshRSS/FreshRSS/pull/6486)
* Fix UI for some drag & drops [#6505](https://github.com/FreshRSS/FreshRSS/pull/6505), [#6508](https://github.com/FreshRSS/FreshRSS/pull/6508)
* i18n
* Improve Czech [#6504](https://github.com/FreshRSS/FreshRSS/pull/6504)
* Improve Turkish [#6506](https://github.com/FreshRSS/FreshRSS/pull/6506)
* Misc.
* Update dev dependencies [#6525](https://github.com/FreshRSS/FreshRSS/pull/6525), [#6526](https://github.com/FreshRSS/FreshRSS/pull/6526), [#6528](https://github.com/FreshRSS/FreshRSS/pull/6528),
[#6529](https://github.com/FreshRSS/FreshRSS/pull/6529), [#6530](https://github.com/FreshRSS/FreshRSS/pull/6530)


## 2024-05-23 FreshRSS 1.24.0

* Features
* New *shareable user query* mechanism to share list of articles by HTML, RSS, OPML [#6052](https://github.com/FreshRSS/FreshRSS/pull/6052)
* New [*shareable user query*](https://freshrss.github.io/FreshRSS/en/users/user_queries.html#share-your-user-queries) mechanism to share list of articles by HTML, RSS, OPML [#6052](https://github.com/FreshRSS/FreshRSS/pull/6052)
* Deprecates RSS sharing with master token
* New JSON scraping mode to consume JSON data [#5662](https://github.com/FreshRSS/FreshRSS/pull/5662), [#6317](https://github.com/FreshRSS/FreshRSS/pull/6317), [#6369](https://github.com/FreshRSS/FreshRSS/pull/6369)
* New JSON scraping mode to consume JSON data [#5662](https://github.com/FreshRSS/FreshRSS/pull/5662), [#6317](https://github.com/FreshRSS/FreshRSS/pull/6317),
[#6369](https://github.com/FreshRSS/FreshRSS/pull/6369), [#6476](https://github.com/FreshRSS/FreshRSS/pull/6476)
* New support for JSON Feeds [#5662](https://github.com/FreshRSS/FreshRSS/pull/5662)
* New support for HTTP POST [#5662](https://github.com/FreshRSS/FreshRSS/pull/5662)
* New options to automatically add labels to incoming articles [#5954](https://github.com/FreshRSS/FreshRSS/pull/5954)
* New option to automatically add labels to incoming articles [#5954](https://github.com/FreshRSS/FreshRSS/pull/5954)
* New button to download a feed configuration as OPML [#6312](https://github.com/FreshRSS/FreshRSS/pull/6312)
* Web scraping support more encodings such as EUC-JP [#6112](https://github.com/FreshRSS/FreshRSS/pull/6112)
* Web scraping support password-protected queries (refactor some cURL options and use `CURLOPT_USERPWD`) [#6177](https://github.com/FreshRSS/FreshRSS/pull/6177)
Expand Down Expand Up @@ -69,14 +92,17 @@
* Improve Czech [#6344](https://github.com/FreshRSS/FreshRSS/pull/6344)
* Improve Dutch [#6343](https://github.com/FreshRSS/FreshRSS/pull/6343)
* Improve German [#6313](https://github.com/FreshRSS/FreshRSS/pull/6313)
* Improve Hungarian [#6005](https://github.com/FreshRSS/FreshRSS/pull/6005), [#6377](https://github.com/FreshRSS/FreshRSS/pull/6377)
* Improve Hungarian [#6005](https://github.com/FreshRSS/FreshRSS/pull/6005), [#6377](https://github.com/FreshRSS/FreshRSS/pull/6377), [#6464](https://github.com/FreshRSS/FreshRSS/pull/6464)
* Improve Indonesian [#6473](https://github.com/FreshRSS/FreshRSS/pull/6473)
* Improve Italian [#6018](https://github.com/FreshRSS/FreshRSS/pull/6018), [#6060](https://github.com/FreshRSS/FreshRSS/pull/6060), [#6329](https://github.com/FreshRSS/FreshRSS/pull/6329)
* Improve Japanese [#6108](https://github.com/FreshRSS/FreshRSS/pull/6108), [#6294](https://github.com/FreshRSS/FreshRSS/pull/6294)
* Improve Korean [#6342](https://github.com/FreshRSS/FreshRSS/pull/6342)
* Improve Polish [#6358](https://github.com/FreshRSS/FreshRSS/pull/6358)
* Improve Portuguese [#6345](https://github.com/FreshRSS/FreshRSS/pull/6345)
* Improve Russian [#6467](https://github.com/FreshRSS/FreshRSS/pull/6467)
* Improve Simplified Chinese [#6336](https://github.com/FreshRSS/FreshRSS/pull/6336)
* Improve Slovakian [#6356](https://github.com/FreshRSS/FreshRSS/issues/6356)
* Improve Spanish [#6471](https://github.com/FreshRSS/FreshRSS/pull/6471)
* Improve Traditional Chinese [#6350](https://github.com/FreshRSS/FreshRSS/pull/6350)
* Improve Turkish [#6328](https://github.com/FreshRSS/FreshRSS/pull/6328)
* Misc. [#6460](https://github.com/FreshRSS/FreshRSS/pull/6460)
Expand All @@ -89,7 +115,7 @@
* New function `Minz_Extension::amendCsp()` for extensions to modify HTTP headers for Content Security Policy [#6246](https://github.com/FreshRSS/FreshRSS/pull/6246)
* New property `FreshRSS_Entry::isUpdated()` for extensions to know whether an entry is new or updated [#6334](https://github.com/FreshRSS/FreshRSS/pull/6334)
* Compatibility
* Restore PHP 7.4 compatibility for automated tests [#6038](https://github.com/FreshRSS/FreshRSS/pull/6038), [#6039](https://github.com/FreshRSS/FreshRSS/pull/6039)
* Fix PHP 7.4 compatibility for automated tests [#6038](https://github.com/FreshRSS/FreshRSS/pull/6038), [#6039](https://github.com/FreshRSS/FreshRSS/pull/6039)
* Fix PHP 8.2+ compatibility for e-mails [#6130](https://github.com/FreshRSS/FreshRSS/pull/6130)
* Use PHP 8.3+ `#[\Override]` [#6273](https://github.com/FreshRSS/FreshRSS/pull/6273)
* Misc.
Expand Down
2 changes: 2 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ People are sorted by name so please keep this order.
* [Joe Stump](https://github.com/joestump): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:joestump), [Web](http://stu.mp)
* [Joel Garcia](https://github.com/joelchrono12): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:joelchrono12), [Web](https://joelchrono12.xyz)
* [Jonas Östanbäck](https://github.com/cez81): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:cez81)
* [Jordi Garcia](https://github.com/jgtorcal): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:jgtorcal)
* [Joris Kinable](https://github.com/jkinable): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:jkinable)
* [Jules Bertholet](https://github.com/Jules-Bertholet): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Jules-Bertholet)
* [Julien Reichardt](https://github.com/j8r): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:j8r), [Web](https://blog.jrei.ch/)
Expand Down Expand Up @@ -197,6 +198,7 @@ People are sorted by name so please keep this order.
* [Quentin Dufour](https://github.com/superboum): [contributions](https://github.com/FreshRSS/documentation/pulls?q=is:pr+author:superboum), [Web](http://quentin.dufour.io/)
* [Quentin Pagès](https://github.com/Quenty31): [contributions](https://github.com/FreshRSS/documentation/pulls?q=is:pr+author:Quenty31)
* [Raineer](https://github.com/Raineer): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Raineer)
* [Ramazan Sancar](https://github.com/ramazansancar): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:ramazansancar), [Web](https://ramazansancar.com.tr/)
* [Ramón Cutanda](https://github.com/rcutanda): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rcutanda)
* [rdmitr](https://github.com/rdmitr): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rdmitr)
* [Rebecca Scott](https://github.com/becdetat): [contirbutions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:becdetat), [Web](https://becdetat.com)
Expand Down
2 changes: 1 addition & 1 deletion Docker/Dockerfile-Alpine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.19
FROM alpine:3.20

ENV TZ UTC
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E
# APIs & native apps

FreshRSS supports access from mobile / native apps for Linux, Android, iOS, Windows and macOS, via two distinct APIs:
[Google Reader API](https://freshrss.github.io/FreshRSS/en/users/06_Mobile_access.html) (best),
and [Fever API](https://freshrss.github.io/FreshRSS/en/users/06_Fever_API.html) (limited features and less efficient).
[Google Reader API](https://freshrss.github.io/FreshRSS/en/developers/06_GoogleReader_API.html) (best),
and [Fever API](https://freshrss.github.io/FreshRSS/en/developers/06_Fever_API.html) (limited features and less efficient).

| App | Platform | Free Software | Maintained & Developed | API | Works offline | Fast sync | Fetch more in individual views | Fetch read articles | Favourites | Labels | Podcasts | Manage feeds |
|:--------------------------------------------------------------------------------------|:-----------:|:-------------------------------------------------------------:|:----------------------:|:----------------:|:-------------:|:---------:|:------------------------------:|:-------------------:|:----------:|:------:|:--------:|:------------:|
Expand Down
4 changes: 2 additions & 2 deletions app/Controllers/apiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function updatePassword(string $apiPasswordPlain) {
FreshRSS_Context::userConf()->apiPasswordHash = $apiPasswordHash;

$feverKey = FreshRSS_fever_Util::updateKey($username, $apiPasswordPlain);
if (!$feverKey) {
if ($feverKey == false) {
return _t('feedback.api.password.failed');
}

Expand Down Expand Up @@ -56,7 +56,7 @@ public function updatePasswordAction(): void {
}

$error = self::updatePassword($apiPasswordPlain);
if ($error) {
if (is_string($error)) {
Minz_Request::bad($error, $return_url);
} else {
Minz_Request::good(_t('feedback.api.password.updated'), $return_url);
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/authController.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function formLoginAction(): void {
$password = Minz_Request::paramString('p');
Minz_Request::_param('p');

if (!$username) {
if ($username === '') {
return;
}

Expand Down
21 changes: 14 additions & 7 deletions app/Controllers/configureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function firstAction(): void {
* The options available on the page are:
* - language (default: en)
* - theme (default: Origin)
* - darkMode (default: no)
* - darkMode (default: auto)
* - content width (default: thin)
* - display of read action in header
* - display of favorite action in header
Expand All @@ -48,7 +48,7 @@ public function displayAction(): void {
FreshRSS_Context::userConf()->language = Minz_Request::paramString('language') ?: 'en';
FreshRSS_Context::userConf()->timezone = Minz_Request::paramString('timezone');
FreshRSS_Context::userConf()->theme = Minz_Request::paramString('theme') ?: FreshRSS_Themes::$defaultTheme;
FreshRSS_Context::userConf()->darkMode = Minz_Request::paramString('darkMode') ?: 'no';
FreshRSS_Context::userConf()->darkMode = Minz_Request::paramString('darkMode') ?: 'auto';
FreshRSS_Context::userConf()->content_width = Minz_Request::paramString('content_width') ?: 'thin';
FreshRSS_Context::userConf()->topline_read = Minz_Request::paramBoolean('topline_read');
FreshRSS_Context::userConf()->topline_favorite = Minz_Request::paramBoolean('topline_favorite');
Expand Down Expand Up @@ -204,6 +204,7 @@ public function shortcutAction(): void {
$default = Minz_Configuration::load(FRESHRSS_PATH . '/config-user.default.php');
$shortcuts = $default['shortcuts'];
}
/** @var array<string,string> $shortcuts */
FreshRSS_Context::userConf()->shortcuts = array_map('trim', $shortcuts);
FreshRSS_Context::userConf()->save();
invalidateHttpCache();
Expand Down Expand Up @@ -384,21 +385,27 @@ public function queryAction(): void {
$queryParams['search'] = htmlspecialchars_decode($params['search'], ENT_QUOTES);
}
if (!empty($params['state']) && is_array($params['state'])) {
$queryParams['state'] = (int)(array_sum($params['state']));
$queryParams['state'] = (int)array_sum($params['state']);
}
if (empty($params['token']) || !is_string($params['token'])) {
$queryParams['token'] = FreshRSS_UserQuery::generateToken($name);
} else {
$queryParams['token'] = $params['token'];
}
if (!empty($params['shareRss']) && ctype_digit($params['shareRss'])) {
$queryParams['shareRss'] = (bool)$params['shareRss'];
$queryParams['url'] = Minz_Url::display(['params' => $queryParams]);
$queryParams['name'] = $name;
if (!empty($params['description']) && is_string($params['description'])) {
$queryParams['description'] = htmlspecialchars_decode($params['description'], ENT_QUOTES);
}
if (!empty($params['imageUrl']) && is_string($params['imageUrl'])) {
$queryParams['imageUrl'] = $params['imageUrl'];
}
if (!empty($params['shareOpml']) && ctype_digit($params['shareOpml'])) {
$queryParams['shareOpml'] = (bool)$params['shareOpml'];
}
$queryParams['url'] = Minz_Url::display(['params' => $queryParams]);
$queryParams['name'] = $name;
if (!empty($params['shareRss']) && ctype_digit($params['shareRss'])) {
$queryParams['shareRss'] = (bool)$params['shareRss'];
}

$queries = FreshRSS_Context::userConf()->queries;
$queries[$id] = (new FreshRSS_UserQuery($queryParams, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray();
Expand Down
23 changes: 17 additions & 6 deletions app/Controllers/entryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public function firstAction(): void {
* - is_read (default: true)
*/
public function readAction(): void {
$id = Minz_Request::param('id');
$get = Minz_Request::paramString('get');
$next_get = Minz_Request::paramString('nextGet') ?: $get;
$id_max = Minz_Request::paramString('idMax') ?: '0';
if (!ctype_digit($id_max)) {
$id_max = '0';
}
$is_read = Minz_Request::paramTernary('is_read') ?? true;
FreshRSS_Context::$search = new FreshRSS_BooleanSearch(Minz_Request::paramString('search'));

Expand All @@ -64,14 +66,14 @@ public function readAction(): void {
$this->view->tagsForEntries = [];

$entryDAO = FreshRSS_Factory::createEntryDao();
if ($id == false) {
// id is false? It MUST be a POST request!
if (!Minz_Request::hasParam('id')) {
// No id, then it MUST be a POST request
if (!Minz_Request::isPost()) {
Minz_Request::bad(_t('feedback.access.not_found'), ['c' => 'index', 'a' => 'index']);
return;
}

if (!$get) {
if ($get === '') {
// No get? Mark all entries as read (from $id_max)
$entryDAO->markReadEntries($id_max, false, FreshRSS_Feed::PRIORITY_MAIN_STREAM, FreshRSS_Feed::PRIORITY_IMPORTANT, null, 0, $is_read);
} else {
Expand Down Expand Up @@ -111,7 +113,16 @@ public function readAction(): void {
}
}
} else {
$ids = is_array($id) ? $id : [$id];
/** @var array<numeric-string> $idArray */
$idArray = Minz_Request::paramArray('id');
$idString = Minz_Request::paramString('id');
if (count($idArray) > 0) {
$ids = $idArray;
} elseif (ctype_digit($idString)) {
$ids = [$idString];
} else {
$ids = [];
}
$entryDAO->markRead($ids, $is_read);
$tagDAO = FreshRSS_Factory::createTagDao();
$tagsForEntries = $tagDAO->getTagsForEntries($ids) ?: [];
Expand Down Expand Up @@ -145,7 +156,7 @@ public function readAction(): void {
public function bookmarkAction(): void {
$id = Minz_Request::paramString('id');
$is_favourite = Minz_Request::paramTernary('is_favorite') ?? true;
if ($id != '') {
if ($id != '' && ctype_digit($id)) {
$entryDAO = FreshRSS_Factory::createEntryDao();
$entryDAO->markFavorite($id, $is_favourite);
}
Expand Down
11 changes: 4 additions & 7 deletions app/Controllers/feedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class FreshRSS_feed_Controller extends FreshRSS_ActionController {
/**
* This action is called before every other action in that class. It is
* the common boiler plate for every action. It is triggered by the
* the common boilerplate for every action. It is triggered by the
* underlying framework.
*/
#[\Override]
Expand Down Expand Up @@ -439,9 +439,8 @@ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url =
$nb_new_articles = 0;

foreach ($feeds as $feed) {
/** @var FreshRSS_Feed|null $feed */
$feed = Minz_ExtensionManager::callHook('feed_before_actualize', $feed);
if (null === $feed) {
if (!($feed instanceof FreshRSS_Feed)) {
continue;
}

Expand Down Expand Up @@ -481,8 +480,6 @@ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url =
}

$feedIsNew = $feed->lastUpdate() <= 0;
$feedIsEmpty = false;
$feedIsUnchanged = false;

try {
if ($simplePiePush !== null) {
Expand Down Expand Up @@ -540,15 +537,15 @@ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url =
$nbMarkedUnread = 0;

if (count($newGuids) > 0) {
if ($feed->attributeBoolean('read_when_same_title_in_feed') === null) {
if (!$feed->hasAttribute('read_when_same_title_in_feed')) {
$readWhenSameTitleInFeed = (int)FreshRSS_Context::userConf()->mark_when['same_title_in_feed'];
} elseif ($feed->attributeBoolean('read_when_same_title_in_feed') === false) {
$readWhenSameTitleInFeed = 0;
} else {
$readWhenSameTitleInFeed = $feed->attributeInt('read_when_same_title_in_feed') ?? 0;
}
if ($readWhenSameTitleInFeed > 0) {
$titlesAsRead = array_flip($feedDAO->listTitles($feed->id(), $readWhenSameTitleInFeed));
$titlesAsRead = array_fill_keys($feedDAO->listTitles($feed->id(), $readWhenSameTitleInFeed), true);
} else {
$titlesAsRead = [];
}
Expand Down
9 changes: 4 additions & 5 deletions app/Controllers/importExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,9 @@ private function ttrssXmlToJson(string $xml) {
unset($table['article']);
for ($i = count($table['items']) - 1; $i >= 0; $i--) {
$item = (array)($table['items'][$i]);
$item = array_filter($item, static function ($v) {
// Filter out empty properties, potentially reported as empty objects
return (is_string($v) && trim($v) !== '') || !empty($v);
});
$item = array_filter($item, static fn($v) =>
// Filter out empty properties, potentially reported as empty objects
(is_string($v) && trim($v) !== '') || !empty($v));
$item['updated'] = isset($item['updated']) ? strtotime($item['updated']) : '';
$item['published'] = $item['updated'];
$item['content'] = ['content' => $item['content'] ?? ''];
Expand Down Expand Up @@ -564,7 +563,7 @@ private function addFeedJson(array $origin): ?FreshRSS_Feed {

// Call the extension hook
$feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed);
if ($feed != null) {
if ($feed instanceof FreshRSS_Feed) {
// addFeedObject checks if feed is already in DB so nothing else to
// check here.
$id = $this->feedDAO->addFeedObject($feed);
Expand Down
Loading

0 comments on commit be67f09

Please sign in to comment.