Commit Graph

118 Commits

Author SHA1 Message Date
Alexandre Alapetite
1acd3ab09b Use typographic quotes (#4133)
* Use typographic quotes

* A few fixes

* Fix

* Fix not saved

* Implement feedback

* Detail

* Revert spoken English fixes
Left for a future dedicated discussion

* More reverts

* Final reverts

* Final minor
2022-01-08 21:58:55 +01:00
Frans de Jonge
d339b6dd45 [CI] PHPCS: check for opening brace on same line (#4122)
* [CI] PHPCS: check for opening brace on same line

* make fix-all

* Minor comments

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-01-05 00:52:24 +01:00
Alexandre Alapetite
1335a0e3cf PHPStan level 5 (#4110)
* Fix most PHPDocs errors
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103
https://phpstan.org/writing-php-code/phpdoc-types

* Avoid func_get_args
Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list
And avoid dynamic functions names when possible to more easily identify calls and unused functions.
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103

* PHPStan level 3

* PHPStand level 4

* Update default to PHPStan level 4

* Towards level 5

* Fix level 4 regression

* Towards level 5

* Pass PHPStan level 5

* Towards level 6

* Remove erronenous regression from changelog
https://github.com/FreshRSS/FreshRSS/pull/4116
2022-01-04 13:59:09 +01:00
Alexandre Alapetite
4e00c2d337 Fix more PHP 8.1 null warnings (#4018)
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4012
2021-12-02 21:05:28 +01:00
Alexandre Alapetite
a473b90ff9 Detect enclosure as images using file extension (#3861)
* Detect enclosure as images using file extension
Support e.g. https://www.sciencesetavenir.fr/atom.xml , which does not include any type hint.

```html
<link rel="enclosure" href="https://example.net/assets/img/ZZZ.jpg" title="YYY"/>
```

Useful for https://github.com/FreshRSS/FreshRSS/pull/3805

* Add AVIF and WebP
2021-09-27 22:24:26 +02:00
Alexandre Alapetite
a7aca6c0ab Improved feed action filters (#3303)
* Re-order some feed options
* Option to auto mark as read existing titles
* Option to keep at max n unread articles per feed
2021-09-19 10:56:38 +02:00
Alexandre Alapetite
ee2d2db780 Fallback for feeds with empty title (#3787)
* Fallback for feeds with empty title
Address a part of https://github.com/FreshRSS/FreshRSS/issues/3776 for existing feeds

* Also strip www prefix

* Reuse fallback logic
2021-08-22 13:33:58 +02:00
Alexandre Alapetite
87d1036647 Fix regression media attachments (#3565)
#fix https://github.com/FreshRSS/FreshRSS/issues/3564
Bug introduced by https://github.com/FreshRSS/FreshRSS/pull/3361
2021-03-27 22:16:44 +01:00
Alexandre Alapetite
eeff1a17b0 Suport standard HTTP 410 Gone (#3561)
When a feed returns an HTTP 410 Gone, mute the corresponding feed, i.e. stop refreshing it.
Example of such feed, Les Décodeurs (Libération) https://rss.liberation.fr/rss/100893/
2021-03-26 19:13:23 +01:00
Alexandre Alapetite
b7fdfbb894 SimplePie prevent cache pollution (#3502)
* SimplePie prevent cache polution
#fix https://github.com/FreshRSS/FreshRSS/pull/3367#issuecomment-766250249
#fix https://github.com/FreshRSS/FreshRSS/pull/3494#issuecomment-790113663

* Fix bug

* Minor improvement

* Update cache filename in FreshRSS (1/2)

* cacheFilename temp

* New SimplePie get_cache_filename()

* Fix typos

* Update lib/SimplePie/SimplePie.php

Typo

* Include user-agent and timeout

* fix array_merge

* Declaration

* force_feed was lost in a commit
2021-03-09 08:41:47 +01:00
Alexandre Alapetite
ef4a826e34 Reload full content when changed (#3506)
* Reload full content when changed
If an article is changed, reload also its full content when applicable.

* Compute hash before getting full content

* Revert mix two PRs

* Update app/Controllers/feedController.php
2021-03-09 08:41:01 +01:00
Alexandre Alapetite
6d8b1ba834 Fix images in enclosures without MIME type (#3361)
#fix https://github.com/FreshRSS/FreshRSS/issues/3358
Assume enclosures without a mime type, without a length, but with either
a width or a height are images
2021-01-12 09:34:13 +01:00
Alexandre Alapetite
c523f5a4e7 Relaxed to allow underscore _ in URL hostnames (#3133)
* Relaxed to allow underscore _ in URL hostnames

#fix https://github.com/FreshRSS/FreshRSS/issues/3132
https://bugs.php.net/bug.php?id=64948

* Minor fix in favicons redirect

* Minor fix in relative HREF for favicons
2020-07-31 16:33:45 +02:00
Alexandre Alapetite
3f9518b377 Hide feed credentials when adding a new feed (#3099)
Avoid showing HTTP Basic Auth credentials in feed error log and in feed
title (when there is no title provided)
2020-07-07 10:54:28 +02:00
Alexandre Alapetite
83b5944dcb Stream instead of memory copy of SimplePie entries (#2972)
* Stream instead of memory copy of SimplePie entries

https://github.com/FreshRSS/FreshRSS/issues/2952

* Undo lines delete

* Typo

* Remove unaccessible code

https://github.com/FreshRSS/FreshRSS/pull/2972/files#r425624163

* Back-compatibility for Feed->entries

https://github.com/FreshRSS/FreshRSS/pull/2972/files#r425631913
2020-05-17 00:04:51 +02:00
Alexandre Alapetite
aea3806590 Attempt to reduce max memory usage during actualize (#2955)
* Attempt to reduce max memory usage during actualize

#Fix https://github.com/FreshRSS/FreshRSS/issues/2952

* Use memory_get_peak_usage
2020-05-10 21:34:12 +02:00
Alexandre Alapetite
b1aac20839 Fever integer type for numbers (#2946)
* Fever integer type for feed ID

#Fix
https://github.com/FreshRSS/FreshRSS/issues/2940#issuecomment-623022435

* Fix feed_id

* Ensure string for entry ID

To be compatible with 32-bit platforms.
Before, the type was inconsistent depending on architecture + database

* Integer for entry count functions
2020-05-03 13:39:16 +02:00
Alexandre Alapetite
83ba09c2a5 Fever integer type for last_refreshed_on_time 2 (#2945)
#Fix fever_last_refreshed_on_time
Try again https://github.com/FreshRSS/FreshRSS/pull/2944
2020-05-02 23:55:10 +02:00
Alexandre Alapetite
dba40e5870 WebSub move fixes (#2922)
Small fixes related to when WebSub changes address:
* When unsubscribing, one must use the current/old address, not the
newly found selfUrl;
* This change
https://github.com/FreshRSS/FreshRSS/pull/2659#discussion_r347263068 was
wrong, so reverted to the first version. We must obey the rules also for
feeds for which the initial WebSub enabling is not finished, otherwise
we never have a chance to redirect the feed to the proper selfUrl.
2020-04-24 16:29:19 +02:00
Alexandre Alapetite
bdc4da6ad0 Expose podcast in API (#2898)
* Expose podcast in API

Expose RSS enclosures in our API, e.g. for clients supporting podcasts

* PHP CS?

* Annoying linter

* Light optimisation
2020-04-16 18:11:26 +02:00
Alexandre Alapetite
925319653d No pre for enclosure-description (#2808)
* No pre for enclosure-description

#fix https://github.com/FreshRSS/FreshRSS/issues/2807
In browsers, the styling `white-space:pre-line` will be applied by CSS,
but no styling will be done for clients via API.

* Corresponding CSS change
2020-02-29 15:58:31 +01:00
Alexandre Alapetite
2aff347b2e Fix wrong getHeader refactoring (#2749)
* Fix wrong getHeader refactoring

Fix regression introduced by
https://github.com/FreshRSS/FreshRSS/pull/2373
The refactoring required a call to init() even for static functions,
which is most of the time not done.
Removed premature abstraction of `$_SERVER`, which was the root cause of
the bug.
https://github.com/FreshRSS/FreshRSS/issues/2748#issuecomment-569898931

* Refactoring: Move serverIsPublic to Minz_Request

* Add mitigations for wrong configurations

Due to the regression, we have some existing configurations with a bad
base_url

* Forgot one instance
2020-01-04 23:35:42 +01:00
Alexis Degrugillier
cc0db9af4f Feature/new archiving (#2335)
* Change archiving config page layout

I've changed some wording and moved actions into a
maintenance section.

* Update purge action

Now we have more control on the purge action. The configuration allows
us to choose what to keep and what to discard in a more precise way.
At the moment, the configuration applies for all feeds.

* Add purge configuration on feed level

Now the extend purge configuration is available on feed level.
It is stored as attributes and will be used in the purge action.

* Update purge action

Now the purge action uses the feed configuration if it exists and
defaults on user configuration if not.

* Add empty option in period list

* Fix configuration warnings

* Add archiving configuration on categories

See #2369

* Add user info back

* Add explanations in UI

* Fixes for SQLite + error + misc.

* Fix invalid feed reference

* Short array syntax

Only for new code, so far

* Fix prefix error

* Query performance, default values

Work in progress

* Fix default values and confirm before leaving

Form cancel and confirm changes before leaving were broken.
And start taking advantage of the short echo syntax `<?= ?>` as we have
moved to PHP 5.4+

* More work

* Tuning SQL

* Fix MariaDB + performance issue

* SQL performance

* Fix SQLite bug

* Fix some attributes JSON encoding bugs

Especially for SQLite export/import

* More uniform, fix bugs

More uniform between global, category, feed settings

* Drop special cases for old articles during refresh

Instead will use lastSeen date with the new archiving logic.
This was generating problems anyway
https://github.com/FreshRSS/FreshRSS/issues/2154

* Draft drop index keep_history

Not needed anymore

* MySQL typo

Now properly tested with MySQL, PostgreSQL, SQLite

* More work for legacy values

Important to avoid overriding user's preference and risking deleting
data erroneously

* Fix PHP 7.3 / 7.4 warnings

@aledeg "Trying to use values of type null, bool, int, float or resource
as an array (such as $null["key"]) will now generate a notice. "
https://php.net/migration74.incompatible

* Reintroduce min articles and take care of legacy parameters

* A few changes forgotten

* Draft of migration + DROP of feed.keep_history

* Fix several errors

And give up using const for SQL to allow multiple database types (and we
cannot redefine a const)

* Add keep_min to categories + factorise archiving logic

* Legacy fix

* Fix bug yield from

* Minor: Use JSON_UNESCAPED_SLASHE for attributes

And make more uniform

* Fix sign and missing variable

* Fine tune the logic
2019-10-23 00:52:15 +02:00
Alexandre Alapetite
e3e5954394 PDO refactoring for code simplification (#2522)
* PDO refactor

* Automatic prefix when using the syntax `_tableName`
* Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query
* Use PDO methods exec(), query(), prepare() + execute() in a more efficient way
* Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old)
* The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language)
* Rename `->bd` to `->pdo` (less of a frenshism, and more informative)
* Fix some requests, which were not compatible with MySQL prepared statements

* Whitespace

* Fix syntax for PostgreSQL sequences

+ MySQL install

* Minor formatting

* Fix lastInsertId for PostgreSQL

* Use PHP 5.6+ const

Take advantage of https://github.com/FreshRSS/FreshRSS/pull/2527
https://www.php.net/manual/en/migration56.new-features.php

* A bit of forgotten PHP 5.6 simplification for cURL

* Forgotten $s

* Mini fix custom user config

https://github.com/FreshRSS/FreshRSS/pull/2490/files#r326290346

* More work on install.php but not finished

* install.php working

* More cleaning of PDO in install

* Even more simplification

Take advantage of PDO->exec() to run multiple statements

* Disallow changing the name of the default category

https://github.com/FreshRSS/FreshRSS/pull/2522#discussion_r326967724
2019-09-29 16:22:50 +02:00
Alexandre Alapetite
1804c0e0bc Filter actions (#2275)
* Draft of filter actions

* Travis

* Implement UI + finish logic

* Travis
2019-03-23 22:52:47 +01:00
Alexandre Alapetite
512d047f02 Update naming to WebSub (#2184)
Instead of PubSubHubbub / PuSH
2018-12-16 17:02:03 +01:00
Alexandre Alapetite
6122a45d9a Minor additional WebSub debug 2018-11-15 17:07:05 +01:00
Alexandre Alapetite
0fce9892ff API encoding tuning (#2120)
Use only minimal XML->Unicode encoding for articles title.
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2093
2018-11-12 09:03:20 +01:00
Alexandre Alapetite
b672fc190d Tweaks for Vienna RSS (#2093)
* Tweaks for Vienna RSS

https://github.com/FreshRSS/FreshRSS/issues/2091
https://github.com/ViennaRSS/vienna-rss/issues/1197

* Fix get feed by URL

* Fix get item ids returning starred elements

* API add item ids by feed URL

* Add API filter `it`

https://feedhq.readthedocs.io/en/latest/api/reference.html#stream-items-ids

* API add `nt=` filter + refactoring

* No ; prefix for author

https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435562495

* Add id long form prefix and accept short id form

https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435631259

* Fix quote problem

https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435683930

* Isolate bug fix for News+

https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435687041

* Rework encoding conventions

https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-437441834

* Unicode escaping alternative

Alternative approach to encode XML special characters and other
problematic characters into their Unicode fullwidth version when we
cannot use HTML-encoding because clients disagree wether they should
HTML-decode or not.
https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-436059559
2018-11-11 17:31:50 +01:00
Alexandre Alapetite
0aecf44294 Option to force clear cache (#2052)
https://github.com/FreshRSS/FreshRSS/issues/1020#issuecomment-428515868
2018-10-17 18:03:50 +02:00
Alexandre Alapetite
b323ed0846 Improve authors (#2025)
* Links for authors and multiple authors

Favour ';' as a separator instead of ',' to better cope with
multi-author scientific articles.
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/1997 ,
https://github.com/FreshRSS/FreshRSS/issues/1968,
https://github.com/FreshRSS/FreshRSS/pull/2023

* Change i18n authors

* Update layout

* Unicode-compatible search

Example for `author:Loïc`

* author <em> styling

* Final details

* Minor spacing
2018-09-16 10:46:27 +02:00
Alexandre Alapetite
af27b6d300 Tags split improvement (#2023)
* Tags split improvement

Some feeds use a single category with comma-separated tags.
Better handling of tags containing a space

* Handle spaces in searches with +

Can now search in tags containing spaces

* Fix searches with spaces for title and author
2018-09-15 13:06:29 +02:00
Alexandre Alapetite
14e1b23e42 Allow multiple authors (#1997)
Fix https://github.com/FreshRSS/FreshRSS/issues/1968
2018-09-02 13:36:46 +02:00
Alexandre Alapetite
99dfdbc10d Avoid feed credentials in logs (#1949)
* Avoid feed credentials in logs

Related to https://github.com/FreshRSS/FreshRSS/pull/1891

* Changelog 1949
2018-07-08 11:29:05 +02:00
Alexandre Alapetite
eb3cca60dd Fix get_thumbnails null exception (#1933) 2018-06-12 12:35:52 +02:00
Alexandre Alapetite
6a56894e94 New extension event + Tumblr GDPR (#1924)
* New extension event + Tumblr GDPR

https://github.com/FreshRSS/FreshRSS/issues/1894
simplepie_before_init event

* Refactor extension enabling + Tumblr GDPR enabled by default

Add possibility for extensions to be enabled by default, and disabled
back by users.

* Minor whitespace
2018-06-09 15:58:18 +02:00
Alexandre Alapetite
7ab4a2609a Support for media: tags (#1920)
* Support for media: tags

https://github.com/FreshRSS/FreshRSS/issues/944
E.g.  YouTube

* Fix for medium attribute

* Changelog 944

https://github.com/FreshRSS/FreshRSS/issues/944
https://github.com/FreshRSS/FreshRSS/pull/1920

* enclosure styling

* Compatibility old enclosure content
2018-06-06 21:29:22 +02:00
Alexandre Alapetite
afad1d11af Fix type exception in loadCompleteContent (#1918)
* Fix type exception in loadCompleteContent

https://github.com/FreshRSS/FreshRSS/issues/1917
With some refactoring

* Changelog 1917

https://github.com/FreshRSS/FreshRSS/issues/1917
https://github.com/FreshRSS/FreshRSS/pull/1918
2018-06-05 13:48:34 +02:00
Alexandre Alapetite
6881d362b1 Detection of non-unique GUIDs (#1887)
* Detection of non-unique GUIDs

Some feeds are using GUIDs, but fail to make them unique.
Example: https://www.kbh-sprogcenter.dk/en/category/danish-break/feed/
This patch detects non-unique GUIDs, and disable GUIDs in that specific
case.

* Add state and log
2018-05-20 12:17:08 +02:00
ColonelMoutarde
a8ffde6263 add visibility "public" (#1849) 2018-05-19 13:16:51 +02:00
Alexandre Alapetite
b552abb332 JSON column for feeds (#1838)
* Draft of JSON column for feeds
https://github.com/FreshRSS/FreshRSS/issues/1654

* Add some per-feed options
  * Feed cURL timeout
  * Mark updated articles as read https://github.com/FreshRSS/FreshRSS/issues/891
  * Mark as read upon reception https://github.com/FreshRSS/FreshRSS/issues/1702
  * Ignore SSL (unsafe) https://github.com/FreshRSS/FreshRSS/issues/1811

* Try PHPCS workaround
While waiting for a better syntax support
2018-05-01 17:02:11 +02:00
perrinjerome
0c066cb428 Feed parsing: use author email when there's no author name (#1801)
This is especially useful because when author is given as
`<author>Author Name</author>` ( as in this example
https://cyber.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt ),
SimplePie will expose *Author Name* as `email`.
2018-02-28 20:08:32 +01:00
Alexis Degrugillier
7642d334f8 Replace "keep history" magic value by a constant (#1759)
I think the use of a magic value repeated many times in the code is prone to have some errors made by people not knowing its meaning. Using a constant is a bit more safe. Judging by some comments in the code, I am not the only one.
2018-01-02 23:53:35 +01:00
Alexis Degrugillier
8c2113f9e6 Add mute strategy configuration (#1750) 2018-01-01 20:34:06 +01:00
Alexandre Alapetite
e399bc4b92 Remove warning for CURLOPT_FOLLOWLOCATION with open_basedir (#1734)
For PHP 5.6.0- http://www.php.net/ChangeLog-5.php#5.6.0
https://bugs.php.net/bug.php?id=65646
https://github.com/FreshRSS/FreshRSS/pull/1733
https://github.com/FreshRSS/FreshRSS/pull/1657
https://github.com/FreshRSS/FreshRSS/issues/1655
2017-12-17 20:14:20 +01:00
Alexandre Alapetite
b1c317a253 Log rotation, use Minz_Log, new log constants
ADMIN_LOG, API_LOG, PSHB_LOG
2017-12-10 21:58:24 +01:00
Alexandre Alapetite
1eb19409b5 CURLOPT_FOLLOWLOCATION open_basedir bug (#1657)
CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set
https://github.com/FreshRSS/FreshRSS/issues/1655#issuecomment-334999448
https://stackoverflow.com/questions/6918623/curlopt-followlocation-cannot-be-activated
2017-10-08 17:26:43 +02:00
Alexandre Alapetite
4058ff3ff4 Remove SimplePie name from HTTP User-Agent string
https://github.com/FreshRSS/FreshRSS/issues/1622#issuecomment-334928486
https://github.com/FreshRSS/FreshRSS/issues/1627
https://github.com/FreshRSS/FreshRSS/issues/1607
2017-10-07 13:51:45 +02:00
Alexandre Alapetite
62d68f8c66 Quick fix PSHB encoding after Travis refactoring
https://github.com/FreshRSS/FreshRSS/pull/1619
Related to https://github.com/FreshRSS/FreshRSS/pull/1633
2017-09-24 12:16:41 +02:00
Alexandre Alapetite
2e8d8834c4 Quick fix small bug from 1619 (#1633)
https://github.com/FreshRSS/FreshRSS/pull/1619
2017-09-22 13:05:42 +02:00