Alexandre Alapetite
edee27ff0f
Merge SimplePie 747 ( #5199 )
...
* Merge SimplePie 747
#fix https://github.com/FreshRSS/FreshRSS/issues/5195
Upstream https://github.com/simplepie/simplepie/pull/747
* Syntax error
2023-03-13 13:10:09 +01:00
Alexandre Alapetite
32acd6c13e
SimplePie use single constant for default HTTP Accept header ( #5083 )
...
* Use single constant for default SimplePie HTTP Accept
And add missing headers in `SimplePie_Locator::body()`
Follow-up of https://github.com/simplepie/simplepie/commit/5d966b9f64a6034f89b019152d7cad9059f8819f
* Update SimplePie default HTTP Accept
Fix https://github.com/FreshRSS/FreshRSS/pull/5079#issuecomment-1421619176
The `*/*` breaks Mastodon content negotiation
* Revert "Update SimplePie default HTTP Accept"
This reverts commit 13a5a5cb3b .
* Same as upstream
2023-03-04 11:18:56 +01:00
Alexandre Alapetite
9b5de54a9c
Remove -x on some files not needing it ( #5065 )
2023-02-03 14:34:47 +01:00
Alexandre Alapetite
8f9c4143fc
Better enclosures ( #4944 )
...
* Better enclosures
#fix https://github.com/FreshRSS/FreshRSS/issues/4702
Improvement of https://github.com/FreshRSS/FreshRSS/pull/2898
* A few fixes
* Better enclosure titles
* Improve thumbnails
* Implement thumbnail for HTML+XPath
* Avoid duplicate enclosures
#fix https://github.com/FreshRSS/FreshRSS/issues/1668
* Fix regex
* Add basic support for media:credit
And use <figure> for enclosures
* Fix link encoding + simplify code
* Fix some SimplePie bugs
Encoding errors in enclosure links
* Remove debugging syslog
* Remove debugging syslog
* SimplePie fix multiple RSS2 enclosures
#fix https://github.com/FreshRSS/FreshRSS/issues/4974
* Improve thumbnails
* Performance with yield
Avoid generating all enclosures if not used
* API keep providing enclosures inside content
Clients are typically not showing the enclosures to the users (tested with News+, FeedMe, Readrops, Fluent Reader Lite)
* Lint
* Fix API output enclosure
* Fix API content strcut
* API tolerate enclosures without a type
2023-01-06 19:53:43 +01:00
Alexandre Alapetite
442019a054
SimplePie fix base ( #4565 )
...
* SimplePie fix base
#fix https://github.com/FreshRSS/FreshRSS/issues/4562
See `<xml:base>` example in https://datatracker.ietf.org/doc/html/rfc4287#section-1.1
First uses item `<xml:base>` if it exists, or the item own link, or the feed's base URL rules (feed URL, or Web site URL)
* Minor formatting
2022-09-05 09:15:20 +02:00
Alexandre Alapetite
191abf5ba5
SimplePie fix status_code type ( #4301 )
...
#fix https://github.com/FreshRSS/FreshRSS/issues/4299
2022-04-02 21:39:20 +02:00
Alexandre Alapetite
b0a63355b6
SimplePie fix parsing of HTTP Links ( #4283 )
...
* SimplePie fix parsing of HTTP Links
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link
* https://datatracker.ietf.org/doc/html/rfc8288
Before, SimplePie was not able to parse something like
```
Link: <https://pubsubhubbub.appspot.com >; rel="hub", <https://pubsubhubbub.superfeedr.com >; rel=hub, <https://websubhub.com/hub >; rel="hub"
```
2022-03-22 23:12:22 +01:00
Alexandre Alapetite
1fe66ad020
Implement Web scraping "HTML + XPath" ( #4220 )
...
* More PHP type hints for Fever
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4201
Related to https://github.com/FreshRSS/FreshRSS/issues/4200
* Detail
* Draft
* Progress
* More draft
* Fix thumbnail PHP type hint
https://github.com/FreshRSS/FreshRSS/issues/4215
* More types
* A bit more
* Refactor FreshRSS_Entry::fromArray
* Progress
* Starts to work
* Categories
* Fonctional
* Layout update
* Fix relative URLs
* Cache system
* Forgotten files
* Remove a debug line
* Automatic form validation of XPath expressions
* data-leave-validation
* Fix reload action
* Simpler examples
* Fix column type for PostgreSQL
* Enforce HTTP encoding
* Readme
* Fix get full content
* target="_blank"
* gitignore
* htmlspecialchars_utf8
* Implement HTML <base>
And fix/revert `xml:base` support in SimplePie https://github.com/simplepie/simplepie/commit/e49c578817aa504d8d05cd7f33857aeda9d41908
* SimplePie upstream PR merged
https://github.com/simplepie/simplepie/pull/723
2022-02-28 20:22:43 +01:00
maTh and Alexandre Alapetite
cb36fe25a7
Improved: Fetch articles with selector but do not delete the class attribute. (Simplepie: new method: rename_attribute) ( #4175 )
...
* added to simplepie: rename_attributes
* rename the class attribute
* Update lib/SimplePie/SimplePie/Sanitize.php
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr >
* added 'id' as attribute to rename to 'data-sanitized-id'
* Update lib_rss.php
* source code in sync with simplepie upstream
* fixed parameters
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr >
2022-02-05 14:15:32 +01:00
Thomas Renes
916df412f5
Fix various typos and spelling errors in documentation, comments and code. ( #4134 )
2022-01-08 16:25:17 +01:00
Alexandre Alapetite
ba0e690235
SimplePie 1.5.8 manual upgrade ( #4113 )
...
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4011
Instead of https://github.com/FreshRSS/FreshRSS/pull/4102
* https://github.com/simplepie/simplepie/commit/bea5de77afc274dc7c36cac39cdf53de346a5b50
* https://github.com/simplepie/simplepie/commit/5aab77e105d4384c9bb1a747010f380c0506f7a2
* https://github.com/simplepie/simplepie/commit/76be63e72ea6867d9982bf9bd97ba706b196d602
2022-01-02 18:11:42 +01:00
Alexandre Alapetite
b21fe199ed
Manual update SimplePie ( #4011 )
...
* https://github.com/simplepie/simplepie/commit/417a1661b2610448bd8e1835d6d4160a0aff9a97
* https://github.com/simplepie/simplepie/commit/ebdd0643ee927edfcaf40bfd27ab23ce9c975120
* https://github.com/simplepie/simplepie/commit/941412027a46979b4f1d29e53edf91829788d781
* https://github.com/simplepie/simplepie/commit/f58a23730f01f26bbcfe02ff9266e337c241be88
2021-12-01 23:24:18 +01:00
Alexandre Alapetite
224b20edd1
Merge upstream SimplePie PR details ( #3614 )
...
https://github.com/simplepie/simplepie/pull/681
https://github.com/simplepie/simplepie/pull/680
https://github.com/simplepie/simplepie/pull/675
2021-05-08 00:56:54 +02:00
Alexandre Alapetite
d0d5f1ce3f
Merge SimplePie changes ( #3588 )
...
Related to https://github.com/simplepie/simplepie/pull/676
from https://github.com/FreshRSS/FreshRSS/pull/1087
2021-04-17 18:10:47 +02:00
Alexandre Alapetite
a57fa9975a
Fix wrong SimplePie type hint ( #3578 )
...
`SimplePie_Cache` also exists but is something else.
2021-04-08 23:34:21 +02:00
Alexandre Alapetite
150015079f
SimplePie fix old regression during manual merge ( #3568 )
...
Bug from https://github.com/FreshRSS/FreshRSS/pull/2136
Related upstream PR https://github.com/simplepie/simplepie/pull/676
2021-03-28 18:33:49 +02: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
0ff6ba4542
SimplePie fix PHP8 uncatched error ( #3547 )
...
#fix https://github.com/FreshRSS/FreshRSS/pull/3546
When `loadHTML()` is given a null or empty string.
```
PHP Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /var/www/freshrss/lib/SimplePie/SimplePie/Locator.php:83
```
2021-03-23 10:54:14 +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
75711c3647
Manual update to SimplePie 1.5.6 ( #3469 )
...
* Manual update to SimplePie 1.5.6
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3206 (1.5.5)
Differences
https://github.com/simplepie/simplepie/compare/692e8bc19bc4aca20b57474cca2a1d234ce89d63...155cfcfacdbf7ee4e9cbb837e70564cdd6a40ac0
Related to https://github.com/FreshRSS/FreshRSS/pull/3416 ,
https://github.com/FreshRSS/FreshRSS/pull/3404
* Typo
2021-02-20 23:38:36 +01:00
0e6ad01dbf
Fix: handle very big feed ( #3416 )
...
* fix: handle big xml files which cause out of memory exceptions by working with chunks in cleanMd5 function (because of preg_replace) and parse (because of xml_parse)
* Review
* Fixes in error handling (case of the last call to xml_parse, case of
error during fopen, break in case of XML error...)
* Takes advantage of the chunking for computing the cache hash
* Larger chunks of 1MB
Co-authored-by: e <bokes74743@tjuln.com >
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr >
2021-02-17 21:50:25 +01:00
Alexandre Alapetite
23c43b1fbf
Fix return type for broken feeds ( #3423 )
...
Fix a rare error when an invalid feed is forced to be added again.
FreshRSS code (not upstream)
2021-02-06 00:58:51 +01:00
Alexandre Alapetite
45ee7a36d5
PHP8: SimplePie wrong use of isset ( #3404 )
...
#fix https://github.com/FreshRSS/FreshRSS/issues/3401 (crash with PHP 8+)
`ceil()` crashes in PHP8+ in case of invalid input such as empty string.
`intval()` fixes the problem with almost identical behaviour than `ceil()` in PHP7- (except for floating point values)
#fix FreshRSS/FreshRSS#3401 (crash with PHP 8+)
Example with feed http://podcast.hr2.de/derTag/podcast.xml
```xml
<enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3 "
length="" type="audio/mpeg"/>
```
`isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+:
```
Uncaught TypeError: ceil(): Argument #1 ($num) must be of type
int|float, string given in ./SimplePie/SimplePie/Item.php:2871
```
Upstream patch https://github.com/simplepie/simplepie/pull/670
2021-01-31 13:04:36 +01:00
Alexandre Alapetite
8ec2b257df
Update SimplePie (PHP8) ( #3206 )
...
Contributes to https://github.com/FreshRSS/FreshRSS/issues/3082
Includes https://github.com/FreshRSS/FreshRSS/pull/3180
Differences:
https://github.com/simplepie/simplepie/compare/aaad78e6da098e14bec4fec552b3a2dbca7a2d45...692e8bc19bc4aca20b57474cca2a1d234ce89d63
2020-10-03 15:18:44 +02:00
Alexandre Alapetite
1c0e7b4feb
SimplePie: Fix HTTP 301 permanent redirection ( #3180 )
...
* SimplePie: Fix HTTP 301 permanent redirection
When adding feeds it worked fine, but detecting permanent redirects for
existing feeds was sometimes broken (only when PHP open_basedir was not
set).
Indeed, using the built-in CURLOPT_FOLLOWLOCATION instead of the manual
method in SimplePie hides the list of HTTP redirects along the way, and
prevents the distinction of e.g. 301 vs. 302 redirects.
This patch disables CURLOPT_FOLLOWLOCATION in SimplePie, and fixes the
manual method at the same time.
The use of CURLOPT_FOLLOWLOCATION was nevertheless not systematic (only
when open_basedir was not set), so now there is only one logic
independent of open_basedir.
I will send a PR upstream to SimplePie.
How to test: pick a feed with 301 redirection such as HTTP to HTTPS,
e.g. http://ing.dk/rss/term/341
Manually change back to previous address (to simulate a feed that is
changing address)
Refresh feed and observe whether the 301 redirect is obeyed.
* Wrong blank
2020-09-17 10:35:56 +02:00
Alexandre Alapetite
9997acd611
Minor SimplePie merge ( #2870 )
...
https://github.com/FreshRSS/FreshRSS/pull/2852 was merged upstream
https://github.com/simplepie/simplepie/pull/643
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2814
2020-04-01 22:42:32 +02:00
Alexandre Alapetite
e424f45b8c
SimplePie use distint cache for force_feed ( #2852 )
...
#fix https://github.com/FreshRSS/FreshRSS/issues/2524
In general, we should avoid using the same cache for feeds that are fetched with distinct parameters / settings..
PR upstream to SimplePie https://github.com/simplepie/simplepie/pull/643
2020-03-28 20:24:31 +01:00
Alexandre Alapetite
9716071918
SimplePie 1.5.4 ( #2814 )
...
https://github.com/simplepie/simplepie/compare/1.5.3..a72e1dfafe7870affdae3edf0d9a494e4fa31bc6
Follow up of the update to 1.5.3
https://github.com/FreshRSS/FreshRSS/pull/2702
Requires PHP 5.6+
https://github.com/FreshRSS/FreshRSS/pull/2527#issuecomment-592952451
2020-02-29 22:29:52 +01:00
Craig Andrews
ecd00854be
Manual update to SimplePie 1.5.3 ( #2702 )
2019-12-06 18:10:06 +01:00
Alexandre Alapetite
0fb21e1473
SimplePie 604 ( #2350 )
...
Cherry-pick https://github.com/simplepie/simplepie/pull/604
2019-04-06 15:51:00 +02:00
Alexandre Alapetite
c9e46dce86
Manual update to SimplePie 1.5.2 ( #2136 )
2018-11-18 11:36:35 +01: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
4c8f147238
Suppress XML error during conversion attempt ( #1909 )
...
Using LIBXML_NOERROR. Seems to be necessary for newer PHP versions
because the at sign does not suppress warnings. In a FreshRSS-specific
SimplePie section.
Warning: DOMDocument::loadXML(): Namespace prefix media on content is
not defined in Entity, line: 42 in
/..../FreshRSS/lib/SimplePie/SimplePie/Parser.php on line 144
2018-05-31 19:22:02 +02:00
Alexandre Alapetite
c96b5ff34a
SimplePie fix for Atom feeds using namespace for type ( #1893 )
...
https://github.com/FreshRSS/FreshRSS/issues/1892
2018-05-22 08:49:11 +02:00
Alexandre Alapetite
f17417e95c
Strip credentials from HTTP Referer ( #1891 )
...
https://github.com/simplepie/simplepie/blob/0edf39018709c0d66cfa6d9b972907bb92461efb/library/SimplePie/File.php#L109
Candidate for pull-request upstream to SimplePie
2018-05-20 23:23:48 +02:00
Alexandre Alapetite
dd65cb0f9c
Manual merge upstream SimplePie
2017-05-28 02:02:21 +02:00
Jonas Östanbäck
e825822ba0
Add syslog_enabled in one more file create call
2017-05-09 19:16:57 +02:00
Jonas Östanbäck
d6bd90a801
Add syslog_enabled when creating new simplepie_file
2017-05-09 17:55:01 +02:00
Alexandre Alapetite
cc235c6af3
SimplePie light manual update
2017-03-26 15:02:35 +02:00
Alexandre Alapetite
0a3ab899a0
Add support for UTF-8 BOM in SimplePie feed_or_html()
...
https://github.com/FreshRSS/FreshRSS/issues/1336
2016-10-20 23:10:15 +02:00
Alexandre Alapetite
a37484fd2f
Fix SimplePie autodiscovery for text/xml HTML pages
...
https://github.com/FreshRSS/FreshRSS/issues/1264
2016-09-25 15:55:28 +02:00
Alexandre Alapetite
531f6ada99
SimplePie better message
2016-08-28 16:37:35 +02:00
Alexandre Alapetite
ccecebc2b4
SimplePie error message XML PCRE
...
https://github.com/FreshRSS/FreshRSS/issues/1227
2016-08-28 16:35:54 +02:00
Alexandre Alapetite
8ae96d000a
SimplePie trim
...
https://github.com/FreshRSS/FreshRSS/issues/1142
2016-04-30 23:53:23 +02:00
Alexandre Alapetite
9e2e5fd594
SimplePie force HTTPS simplifie code
...
https://github.com/FreshRSS/FreshRSS/issues/1083
https://github.com/FreshRSS/FreshRSS/pull/1087
2016-03-01 19:48:52 +01:00
Alexandre Alapetite
c1de11f17d
SimplePie force HTTPS bug with sub-domains
...
https://github.com/FreshRSS/FreshRSS/issues/1083
2016-03-01 19:14:26 +01:00
Alexandre Alapetite
0eef625b6d
SimplePie force HTTPS for enclosures
...
https://github.com/FreshRSS/FreshRSS/issues/1083
https://github.com/FreshRSS/FreshRSS/pull/1087
2016-02-29 20:38:21 +01:00
Alexandre Alapetite
685c0ad2f8
SimplePie HTTPS updated comments
...
https://github.com/FreshRSS/FreshRSS/issues/1083
2016-02-29 17:20:23 +01:00
Alexandre Alapetite
d344da59fd
HTTPS search tree: simplify code
...
https://github.com/FreshRSS/FreshRSS/issues/1083
2016-02-29 17:09:44 +01:00
Alexandre Alapetite
9711f02db7
SimplePie Force HTTPS custom list domains
...
Load from data/force-https.default.txt and data/force-https.txt
Efficient tree structure to search the domains
https://github.com/FreshRSS/FreshRSS/pull/1087
2016-02-28 21:34:54 +01:00