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 Sep 8, 2024
2 parents 59306d1 + af37d88 commit 69901d0
Show file tree
Hide file tree
Showing 123 changed files with 1,712 additions and 1,305 deletions.
33 changes: 31 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,50 @@

See also [the FreshRSS releases](https://github.com/FreshRSS/FreshRSS/releases).

## 2024-XX-XX FreshRSS 1.25.0-dev

## 2024-0X-XX FreshRSS 1.24.3-dev
* Features
* Add support for [regex search (regular expressions)](https://freshrss.github.io/FreshRSS/en/users/10_filter.html#regex) [#6706](https://github.com/FreshRSS/FreshRSS/pull/6706)
* ⚠️ Advanced regex syntax for searches depends on the database used (SQLite, PostgreSQL, MariaDB, MySQL),
but FreshRSS filter actions such as auto-mark-as-read and auto-favourite always use [PHP PCRE2 syntax](https://php.net/regexp.introduction).
* Update `phpgt/cssxpath` library with improved CSS selectors with support for `last-child`, `first-of-type`, `last-of-type`, `^=`, `|=` [#6618](https://github.com/FreshRSS/FreshRSS/pull/6618)
* Bug fixing
* Use curl to fetch extensions list (allows e.g. IPv6) [#6767](https://github.com/FreshRSS/FreshRSS/pull/6767)
* Compatibility
* Require PHP 8.1+ (drop PHP 7.4) [#6711](https://github.com/FreshRSS/FreshRSS/pull/6711)
* Improved support of PHP 8.4+ [#6618](https://github.com/FreshRSS/FreshRSS/pull/6618), [PhpGt/CssXPath#227](https://github.com/PhpGt/CssXPath/pull/227),
[#6781](https://github.com/FreshRSS/FreshRSS/pull/6781)
* Require PostgreSQL 10+ (drop PostgreSQL 9.5) [#6705](https://github.com/FreshRSS/FreshRSS/pull/6705)
* Require MariaDB 10.0.5+ (drop MariaDB 5.5) [#6706](https://github.com/FreshRSS/FreshRSS/pull/6706)
* Requiring MySQL 8+ (drop MySQL 5.5.3) [#6706](https://github.com/FreshRSS/FreshRSS/pull/6706)
* Deployment
* Docker: dev image `freshrss/freshrss:oldest` updated to Alpine 3.16 with PHP 8.1.22 and Apache 2.4.59 [#6711](https://github.com/FreshRSS/FreshRSS/pull/6711)
* UI
* Default styles for `<pre>` and `<code>` [#6770](https://github.com/FreshRSS/FreshRSS/pull/6770)
* Misc.
* Better cache name for JSON feeds [#6768](https://github.com/FreshRSS/FreshRSS/pull/6768)
* Update dev dependencies [#6780](https://github.com/FreshRSS/FreshRSS/pull/6780)


## 2024-09-06 FreshRSS 1.24.3

* Bug fixing
* Fix mark-as-read from user query [#6738](https://github.com/FreshRSS/FreshRSS/pull/6738)
* Fix regression for shortcut to move between categories [#6741](https://github.com/FreshRSS/FreshRSS/pull/6741)
* Fix feed title option [#6771](https://github.com/FreshRSS/FreshRSS/pull/6771)
* Fix XPath for HTML documents with broken root (used by CSS selectors to fetch full content) [#6774](https://github.com/FreshRSS/FreshRSS/pull/6774)
* Fix UI regression in Mapco/Ansum themes [#6740](https://github.com/FreshRSS/FreshRSS/pull/6740)
* Fix minor style bug with some themes [#6746](https://github.com/FreshRSS/FreshRSS/pull/6746)
* Fix export of OPML information for date format of JSON and HTML+XPath feeds [#6779](https://github.com/FreshRSS/FreshRSS/pull/6779)
* Security
* OpenID Connect better definition of session parameters [#6730](https://github.com/FreshRSS/FreshRSS/pull/6730)
* Compatibility
* Last version supporting PHP 7.4
* Misc.
* Use charset for JSON requests from the UI [#6710](https://github.com/FreshRSS/FreshRSS/pull/6710)
* Use `.html` extension for the local cache of full content pages instead of `.spc` [#6724](https://github.com/FreshRSS/FreshRSS/pull/6724)
* Update dev dependencies [#6739](https://github.com/FreshRSS/FreshRSS/pull/6739)
* Update dev dependencies [#6739](https://github.com/FreshRSS/FreshRSS/pull/6739), [#6758](https://github.com/FreshRSS/FreshRSS/pull/6758),
[#6759](https://github.com/FreshRSS/FreshRSS/pull/6759), [#6760](https://github.com/FreshRSS/FreshRSS/pull/6760)


## 2024-08-23 FreshRSS 1.24.2
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If you have to create a new ticket, try to apply the following advice:
- We also need some information:
- Your FreshRSS version (on about page or `constants.php` file)
- Your server configuration: type of hosting, PHP version
- Your storage system (SQLite, MySQL, MariaDB, PostgreSQL)
- Your storage system (SQLite, PostgreSQL, MariaDB, MySQL)
- If possible, the related logs (PHP logs and FreshRSS logs under `data/users/your_user/log.txt`)

## Fix a bug
Expand Down
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ People are sorted by name so please keep this order.
* [otaconix](https://github.com/otaconix): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:otaconix)
* [Pablo Caro](https://github.com/pcaro90): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:pcaro90), [Web](https://pcaro.es/)
* [PAHXO](https://github.com/PAHXO): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:PAHXO)
* [pando85](https://github.com/pando85): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:pando85)
* [papaschloss](https://github.com/papaschloss): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:papaschloss)
* [Patrick Crandol](https://github.com/pattems): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:pattems)
* [Paulius Šukys](https://github.com/psukys): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:psukys), [Web](http://sukys.eu)
Expand Down
14 changes: 7 additions & 7 deletions Docker/Dockerfile-Oldest
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM alpine:3.13
FROM alpine:3.16

ENV TZ UTC
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]

RUN apk add --no-cache \
tzdata \
apache2 php7-apache2 \
php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \
php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-opcache php7-openssl php7-phar php7-session php7-simplexml php7-xmlreader php7-xmlwriter php7-xml php7-tokenizer php7-zlib \
php7-pdo_sqlite php7-pdo_mysql php7-pdo_pgsql
apache2 php81-apache2 \
php81 php81-curl php81-gmp php81-intl php81-mbstring php81-xml php81-zip \
php81-ctype php81-dom php81-fileinfo php81-iconv php81-json php81-opcache php81-openssl php81-phar php81-session php81-simplexml php81-xmlreader php81-xmlwriter php81-xml php81-tokenizer php81-zlib \
php81-pdo_sqlite php81-pdo_mysql php81-pdo_pgsql

RUN mkdir -p /var/www/FreshRSS /run/apache2/
WORKDIR /var/www/FreshRSS
Expand Down Expand Up @@ -39,8 +39,8 @@ RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \
/etc/apache2/httpd.conf && \
sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
/etc/apache2/httpd.conf && \
if [ ! -f /usr/bin/php ]; then ln -s /usr/bin/php7 /usr/bin/php; else true; fi && \
echo 'memory_limit = 256M' > /etc/php7/conf.d/10_memory.ini && \
if [ ! -f /usr/bin/php ]; then ln -s /usr/bin/php81 /usr/bin/php; else true; fi && \
echo 'memory_limit = 256M' > /etc/php81/conf.d/10_memory.ini && \
# Disable built-in updates when using Docker, as the full image is supposed to be updated instead.
sed -r -i "\\#disable_update#s#^.*#\t'disable_update' => true,#" ./config.default.php && \
touch /var/www/FreshRSS/Docker/env.txt && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ lint-fix: vendor/bin/phpcbf ## Fix the errors detected by the linter

bin/composer:
mkdir -p bin/
wget 'https://raw.githubusercontent.com/composer/getcomposer.org/163a517dbb7eba0eb25633061c76e648392c6738/web/installer' -O - -q | php -- --quiet --install-dir='./bin/' --filename='composer'
wget 'https://raw.githubusercontent.com/composer/getcomposer.org/1a26c0dcb361332cb504e4861ed0f758281575aa/web/installer' -O - -q | php -- --quiet --install-dir='./bin/' --filename='composer'

vendor/bin/phpunit: bin/composer
bin/composer install --prefer-dist --no-progress
Expand Down
4 changes: 2 additions & 2 deletions README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ FreshRSS n’est fourni avec aucune garantie.
* Serveur modeste, par exemple sous Linux ou Windows
* Fonctionne même sur un Raspberry Pi 1 avec des temps de réponse < 1s (testé sur 150 flux, 22k articles)
* Serveur Web Apache2.4+ (recommandé), ou nginx, lighttpd (non testé sur les autres)
* PHP 7.4+
* PHP 8.1+
* Extensions requises : [cURL](https://www.php.net/curl), [DOM](https://www.php.net/dom), [JSON](https://www.php.net/json), [XML](https://www.php.net/xml), [session](https://www.php.net/session), [ctype](https://www.php.net/ctype)
* Extensions recommandées : [PDO_SQLite](https://www.php.net/pdo-sqlite) (pour l’export/import), [GMP](https://www.php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](https://www.php.net/intl.idn) (pour les noms de domaines internationalisés), [mbstring](https://www.php.net/mbstring) (pour le texte Unicode), [iconv](https://www.php.net/iconv) (pour conversion d’encodages), [ZIP](https://www.php.net/zip) (pour import/export), [zlib](https://www.php.net/zlib) (pour les flux compressés)
* Extension pour base de données : [PDO_PGSQL](https://www.php.net/pdo-pgsql) ou [PDO_SQLite](https://www.php.net/pdo-sqlite) ou [PDO_MySQL](https://www.php.net/pdo-mysql)
* PostgreSQL 9.5+ ou SQLite ou MySQL 5.5.3+ ou MariaDB 5.5+
* PostgreSQL 10+ ou SQLite ou MariaDB 10.0.5+ ou MySQL 8.0+

# [Installation](https://freshrss.github.io/FreshRSS/fr/users/01_Installation.html)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ FreshRSS comes with absolutely no warranty.
* Works on mobile (except a few features)
* Light server running Linux or Windows
* It even works on Raspberry Pi 1 with response time under a second (tested with 150 feeds, 22k articles)
* A web server: Apache2.4+ (recommended), nginx, lighttpd (not tested on others)
* PHP 7.4+
* A Web server: Apache2.4+ (recommended), nginx, lighttpd (not tested on others)
* PHP 8.1+
* Required extensions: [cURL](https://www.php.net/curl), [DOM](https://www.php.net/dom), [JSON](https://www.php.net/json), [XML](https://www.php.net/xml), [session](https://www.php.net/session), [ctype](https://www.php.net/ctype)
* Recommended extensions: [PDO_SQLite](https://www.php.net/pdo-sqlite) (for export/import), [GMP](https://www.php.net/gmp) (for API access on 32-bit platforms), [IDN](https://www.php.net/intl.idn) (for Internationalized Domain Names), [mbstring](https://www.php.net/mbstring) (for Unicode strings), [iconv](https://www.php.net/iconv) (for charset conversion), [ZIP](https://www.php.net/zip) (for import/export), [zlib](https://www.php.net/zlib) (for compressed feeds)
* Extension for database: [PDO_PGSQL](https://www.php.net/pdo-pgsql) or [PDO_SQLite](https://www.php.net/pdo-sqlite) or [PDO_MySQL](https://www.php.net/pdo-mysql)
* PostgreSQL 9.5+ or SQLite or MySQL 5.5.3+ or MariaDB 5.5+
* PostgreSQL 10+ or SQLite or MariaDB 10.0.5+ or MySQL 8.0+

# [Installation](https://freshrss.github.io/FreshRSS/en/admins/03_Installation.html)

Expand Down
3 changes: 1 addition & 2 deletions app/Controllers/apiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ class FreshRSS_api_Controller extends FreshRSS_ActionController {
/**
* Update the user API password.
* Return an error message, or `false` if no error.
* @return false|string
*/
public static function updatePassword(string $apiPasswordPlain) {
public static function updatePassword(string $apiPasswordPlain): string|false {
$username = Minz_User::name();
if ($username == null) {
return _t('feedback.api.password.failed');
Expand Down
16 changes: 7 additions & 9 deletions app/Controllers/configureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,17 @@ public function displayAction(): void {
public function readingAction(): void {
if (Minz_Request::isPost()) {
FreshRSS_Context::userConf()->posts_per_page = Minz_Request::paramInt('posts_per_page') ?: 10;
FreshRSS_Context::userConf()->view_mode = Minz_Request::paramString('view_mode', true) ?: 'normal';
FreshRSS_Context::userConf()->default_view = Minz_Request::paramString('default_view') ?: 'adaptive';
FreshRSS_Context::userConf()->view_mode = Minz_Request::paramStringNull('view_mode', true) ?? 'normal';
FreshRSS_Context::userConf()->default_view = Minz_Request::paramStringNull('default_view') ?? 'adaptive';
FreshRSS_Context::userConf()->show_fav_unread = Minz_Request::paramBoolean('show_fav_unread');
FreshRSS_Context::userConf()->auto_load_more = Minz_Request::paramBoolean('auto_load_more');
FreshRSS_Context::userConf()->display_posts = Minz_Request::paramBoolean('display_posts');
FreshRSS_Context::userConf()->display_categories = Minz_Request::paramString('display_categories') ?: 'active';
FreshRSS_Context::userConf()->show_tags = Minz_Request::paramString('show_tags') ?: '0';
FreshRSS_Context::userConf()->display_categories = Minz_Request::paramStringNull('display_categories') ?? 'active';
FreshRSS_Context::userConf()->show_tags = Minz_Request::paramStringNull('show_tags') ?? '0';
FreshRSS_Context::userConf()->show_tags_max = Minz_Request::paramInt('show_tags_max');
FreshRSS_Context::userConf()->show_author_date = Minz_Request::paramString('show_author_date') ?: '0';
FreshRSS_Context::userConf()->show_feed_name = Minz_Request::paramString('show_feed_name') ?: 't';
FreshRSS_Context::userConf()->show_article_icons = Minz_Request::paramString('show_article_icons') ?: 't';
FreshRSS_Context::userConf()->show_author_date = Minz_Request::paramStringNull('show_author_date') ?? '0';
FreshRSS_Context::userConf()->show_feed_name = Minz_Request::paramStringNull('show_feed_name') ?? 't';
FreshRSS_Context::userConf()->show_article_icons = Minz_Request::paramStringNull('show_article_icons') ?? 't';
FreshRSS_Context::userConf()->hide_read_feeds = Minz_Request::paramBoolean('hide_read_feeds');
FreshRSS_Context::userConf()->onread_jump_next = Minz_Request::paramBoolean('onread_jump_next');
FreshRSS_Context::userConf()->lazyload = Minz_Request::paramBoolean('lazyload');
Expand Down Expand Up @@ -479,8 +479,6 @@ public function bookmarkQueryAction(): void {
* - user category limit (default: 16384)
* - user feed limit (default: 16384)
* - user login duration for form auth (default: FreshRSS_Auth::DEFAULT_COOKIE_DURATION)
*
* The `force-email-validation` is ignored with PHP < 5.5
*/
public function systemAction(): void {
if (!FreshRSS_Auth::hasAccess('admin')) {
Expand Down
4 changes: 2 additions & 2 deletions app/Controllers/extensionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public function indexAction(): void {
*/
protected function getAvailableExtensionList(): array {
$extensionListUrl = 'https://raw.githubusercontent.com/FreshRSS/Extensions/master/extensions.json';
$json = @file_get_contents($extensionListUrl);
$json = httpGet($extensionListUrl, CACHE_PATH . '/extension_list.json', 'json');

// we ran into problems, simply ignore them
if ($json === false) {
if ($json === '') {
Minz_Log::error('Could not fetch available extension from GitHub');
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/feedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ private static function keepMaxUnreads(FreshRSS_Feed ...$feeds): int {
* @param int $nbNewEntries The number of top recent entries to process.
* @return int|false The number of new labels added, or false in case of error.
*/
private static function applyLabelActions(int $nbNewEntries) {
private static function applyLabelActions(int $nbNewEntries): int|false {
$tagDAO = FreshRSS_Factory::createTagDao();
$labels = FreshRSS_Context::labels();
$labels = array_filter($labels, static function (FreshRSS_Tag $label) {
Expand Down
17 changes: 4 additions & 13 deletions app/Controllers/importExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ public function indexAction(): void {
FreshRSS_View::prependTitle(_t('sub.import_export.title') . ' · ');
}

/**
* @return float|int|string
*/
private static function megabytes(string $size_str) {
private static function megabytes(string $size_str): float|int|string {
switch (substr($size_str, -1)) {
case 'M':
case 'm':
Expand All @@ -51,10 +48,7 @@ private static function megabytes(string $size_str) {
return $size_str;
}

/**
* @param string|int $mb
*/
private static function minimumMemory($mb): void {
private static function minimumMemory(int|string $mb): void {
$mb = (int)$mb;
$ini = self::megabytes(ini_get('memory_limit') ?: '0');
if ($ini < $mb) {
Expand Down Expand Up @@ -240,11 +234,8 @@ private static function guessFileType(string $filename): string {
return 'unknown';
}

/**
* @return false|string
*/
private function ttrssXmlToJson(string $xml) {
$table = (array)simplexml_load_string($xml, null, LIBXML_NOBLANKS | LIBXML_NOCDATA);
private function ttrssXmlToJson(string $xml): string|false {
$table = (array)simplexml_load_string($xml, options: LIBXML_NOBLANKS | LIBXML_NOCDATA);
$table['items'] = $table['article'] ?? [];
unset($table['article']);
for ($i = count($table['items']) - 1; $i >= 0; $i--) {
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/updateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function hasGitUpdate(): bool {
}

/** @return string|true */
public static function gitPull() {
public static function gitPull(): string|bool {
Minz_Log::notice(_t('admin.update.viaGit'));
$cwd = getcwd();
if ($cwd === false) {
Expand Down
18 changes: 6 additions & 12 deletions app/Models/CategoryDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ protected function autoUpdateDb(array $errorInfo): bool {

/**
* @param array{'name':string,'id'?:int,'kind'?:int,'lastUpdate'?:int,'error'?:int|bool,'attributes'?:string|array<string,mixed>} $valuesTmp
* @return int|false
*/
public function addCategory(array $valuesTmp) {
public function addCategory(array $valuesTmp): int|false {
// TRIM() to provide a type hint as text
// No tag of the same name
$sql = <<<'SQL'
Expand Down Expand Up @@ -136,8 +135,7 @@ public function addCategory(array $valuesTmp) {
}
}

/** @return int|false */
public function addCategoryObject(FreshRSS_Category $category) {
public function addCategoryObject(FreshRSS_Category $category): int|false {
$cat = $this->searchByName($category->name());
if (!$cat) {
$values = [
Expand All @@ -153,9 +151,8 @@ public function addCategoryObject(FreshRSS_Category $category) {

/**
* @param array{'name':string,'kind':int,'attributes'?:array<string,mixed>|mixed|null} $valuesTmp
* @return int|false
*/
public function updateCategory(int $id, array $valuesTmp) {
public function updateCategory(int $id, array $valuesTmp): int|false {
// No tag of the same name
$sql = <<<'SQL'
UPDATE `_category` SET name=?, kind=?, attributes=? WHERE id=?
Expand Down Expand Up @@ -187,8 +184,7 @@ public function updateCategory(int $id, array $valuesTmp) {
}
}

/** @return int|false */
public function updateLastUpdate(int $id, bool $inError = false, int $mtime = 0) {
public function updateLastUpdate(int $id, bool $inError = false, int $mtime = 0): int|false {
$sql = 'UPDATE `_category` SET `lastUpdate`=?, error=? WHERE id=?';
$values = [
$mtime <= 0 ? time() : $mtime,
Expand All @@ -206,8 +202,7 @@ public function updateLastUpdate(int $id, bool $inError = false, int $mtime = 0)
}
}

/** @return int|false */
public function deleteCategory(int $id) {
public function deleteCategory(int $id): int|false {
if ($id <= self::DEFAULTCATEGORYID) {
return false;
}
Expand Down Expand Up @@ -345,8 +340,7 @@ public function getDefault(): ?FreshRSS_Category {
}
}

/** @return int|bool */
public function checkDefault() {
public function checkDefault(): int|bool {
$def_cat = $this->searchById(self::DEFAULTCATEGORYID);

if ($def_cat == null) {
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public static function getRevertState(int $state): int {
* @phpstan-return ($asArray is true ? array{'a'|'c'|'f'|'i'|'s'|'t'|'T',bool|int} : string)
* @return string|array{string,bool|int}
*/
public static function currentGet(bool $asArray = false) {
public static function currentGet(bool $asArray = false): string|array {
if (self::$current_get['all']) {
return $asArray ? ['a', true] : 'a';
} elseif (self::$current_get['important']) {
Expand Down
Loading

0 comments on commit 69901d0

Please sign in to comment.