aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2023-03-04SimplePie use single constant for default HTTP Accept header (#5083)Gravatar Alexandre Alapetite
* 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 13a5a5cb3b2fa6bdd57be8b3f84dc37ed814ccf6. * Same as upstream
2023-02-09XML+XPath (#5076)Gravatar Alexandre Alapetite
* XML+XPath #fix https://github.com/FreshRSS/FreshRSS/issues/5075 Implementation allowing to take an XML document as input using an XML parser (instead of an HTML parser for HTML+XPath) * Remove noise from another PR * Better MIME for XML * And add glob *.xml for cache cleaning * Minor syntax * Add glob json for clean cache
2023-02-06More robust application of access permissions (#5062)Gravatar Alexandre Alapetite
* More robust application of access permissions We were in particular missing directory traversal `+X` in our current recommendations. Extracted to own shell script so it can easily be invoked. Update access permissions in Docker to account to be more robust. #fix https://github.com/FreshRSS/FreshRSS/discussions/5037 * Minor simplification * Restrict mkdir permissions Default mkdir permissions are 0777, which is not good for security, so downgrade to 0770.
2023-02-03Type hinting and doc (#5063)Gravatar Luc SANCHEZ
* Type hinting and doc * fix cs * Remove declare strict * Remove declare strict * Pass PHPStan level 9 Revert too boolean syntax * Minor wording * Fix revert typo --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-02-03Remove -x on some files not needing it (#5065)Gravatar Alexandre Alapetite
2023-01-30Workaround disabled openlog syslog (#5054)Gravatar Alexandre Alapetite
* Workaround disabled openlog syslog #fix https://github.com/FreshRSS/FreshRSS/issues/5053 #fix https://github.com/FreshRSS/FreshRSS/issues/5027 * COPY_SYSLOG_TO_STDERR * Better return * Simplify openlog
2023-01-29PHPStan level 9 for ./p/ and lib_rss.php (#5049)Gravatar Alexandre Alapetite
And app/FreshRSS.php Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-01-26Fix error handling when updating URL (#5039)Gravatar Alexandre Alapetite
Fix 3 related error handling when updating the feed URL with an invalid URL. Previously leading to unclear 500 page with additional PHP errors.
2023-01-18i18n safer vsprintf (#5022)Gravatar Alexandre Alapetite
Fix bug introduced by https://github.com/FreshRSS/FreshRSS/pull/4807 though only for the French i18n, wich has some `%` signs in the URL, making `vsprintf` to crash. Only use `vsprintf`` when we call the translation with some parameters, otherwise skip it (probably faster as well).
2023-01-18tec: Update the lib_opml (#4403)Gravatar berumuron
* fix: Fix undefined GLOB_BRACE on Alpine The manual states that: > Note: The GLOB_BRACE flag is not available on some non GNU systems, > like Solaris or Alpine Linux. This generated an error on Alpine. Reference: https://www.php.net/manual/function.glob.php * fix: List details of feeds for OPML exportation The details are necessary to export the XPath information, the CSS full content path and read actions filters. * Update LibOpml to 0.4.0 * Refactor OPML importation to be more robust First, it fixes two regressions introduced by the update of lib_opml: - title attribute is used when text attribute is missing; - the OPML category attribute is used as a fallback for feeds categories. In a related way, if also fixes a problem when a feed had both a parent category outline and a category attribute. Before, it only considered the attribute as its category, but now it considers the parent outline. Then, it counts category limit correctly by not increasing `$nb_categories` if the category already exists. * Exclude lib_opml from the CodeSniffer * Fix variable names when logging some errors * Fix catch of LibOpml Exception * Make sure to declare the category * Exclude lib_opml from PHPStan analyze * Disable markdownlint for lib_opml * Fix typos * Use auto-loading and allow updates via Composer * Fix broken links to lib_opml * Bring back the ability to import the OPML frss:opmlUrl attribute * Refactor the logs of OPML errors * Update lib_opml to the version 0.5.0 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-01-11API avoid logging passwords (#5001)Gravatar Alexandre Alapetite
* API avoid logging passwords * Strip passwords and tokens from API logs * Only log failed requests information when in debug mode * Remove debug SHA * Clean also Apache logs * Better comments * Redact also token parameters * shfmt * Simplify whitespace * redacted
2023-01-09Update dev dependencies (#4993)Gravatar Alexandre Alapetite
Related to https://github.com/FreshRSS/FreshRSS/pull/4991 Required a few changes in code to pass the tests
2023-01-06Better enclosures (#4944)Gravatar Alexandre Alapetite
* 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
2022-11-22Improved: Minz Framework. Byebye Internet Explorer and its Conditional ↵Gravatar maTh
comments (#4651) * Update View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2022-11-15Fix type hints regressions (#4855)Gravatar Alexandre Alapetite
Fix regressions from https://github.com/FreshRSS/FreshRSS/pull/4561 Example: ``` PHP Fatal error: Uncaught TypeError: Argument 1 passed to checkToken() must be an instance of FreshRSS_UserConfiguration, instance of Minz_Configuration given, called in /var/www/FreshRSS/p/api/greader.php on line 1091 and defined in /var/www/FreshRSS/p/api/greader.php:223 Stack trace: #0 /var/www/FreshRSS/p/api/greader.php(1091): checkToken() #1 {main} thrown in /var/www/FreshRSS/p/api/greader.php on line 223 ``` Improvement of https://github.com/FreshRSS/FreshRSS/pull/4110
2022-11-14Require PHP 7.2+ (#4848)Gravatar Alexandre Alapetite
Drop PHP 7.0- as planned https://github.com/FreshRSS/FreshRSS/discussions/3321#discussioncomment-835704
2022-11-14NFS-friendly is_writable() checks (#4780)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4779
2022-10-18Remove ajax parameter when modifying the request (#4743)Gravatar Alexis Degrugillier
Before, when clicking on the author name to use as a filter, the displayed page was a result page from the ajax query. This was due to the use of the ajax parameter in the query. Now, the ajax parameter is removed from the query before displaying the filters. Fix #4726
2022-10-03Allow redirection after login (#4654)Gravatar Alexis Degrugillier
Before, if you've tried to reach a page without being logged, you'll be automatically redirected to the index page after login. Now, the original page is used after login. Fix #3663
2022-09-20GLOB_BRACE is not available on all platforms (#4628)Gravatar Alexandre Alapetite
https://php.net/glob #fix https://github.com/FreshRSS/FreshRSS/issues/4627 Improvement of https://github.com/FreshRSS/FreshRSS/pull/4220
2022-09-19fix: Fix preg_match in enforceHttpEncoding (#4623)Gravatar berumuron
`preg_match` can return `1`, `0` or `false`. In this last case, `enforceHttpEncoding` was trying to access `$matches[1]`, even if the regex wasn't matching.
2022-09-09Workaround invalid OPMLs (#4591)Gravatar Alexandre Alapetite
* Workaround invalid OPMLs #fix https://github.com/FreshRSS/FreshRSS/issues/4590 Accept OPML files lacking text attributes * Tolerate missing head element
2022-09-05SimplePie fix base (#4565)Gravatar Alexandre Alapetite
* 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-08-21Improved: error page (#4465)Gravatar maTh
* error page: true HTML page * error page: http500 erorr * error page: add CSP header * 'log.txt' replaced by LOG_FILENAME * use ADMIN_LOG * log.txt => LOG_FILENAME * error message: add <title> * Docs created * delete: documentation on error message page * line break added * added: new line at the end * typo fixed * Update lib/lib_rss.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update lib/lib_rss.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Minz HTTP 500 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-08-18CssXPath-StarSelector (#4506)Gravatar Alexandre Alapetite
* CssXPath-StarSelector Add support for selectors such as `a[href*="example"]` https://developer.mozilla.org/docs/Web/CSS/Attribute_selectors Translated to `.//a[contains(@href,"example")]` Upstream PR: https://github.com/PhpGt/CssXPath/pull/181 * Upstream merged
2022-07-27Fix: logs page=0 error (#4460)Gravatar maTh
* add docs of function param() * page < 0 is impossible now * show prev/next only, when there is a prev/next page * set always page params * Revert "page < 0 is impossible now" This reverts commit fdb920ee50efe2c5cf64ca2dec936ec28ab2ee6c. * Update logs_pagination.phtml
2022-07-19Fix/Improved: Slider mobile (#4416)Gravatar maTh
* add close button, add content slider div * add &ajax=1#slider to the links * CSS * fix showPW functionality * open slider after received Ajax * do not show empty slider * RTL CSS * fixed code smell * improved: links prep via JS * Redirect anchor * enable #anchors in printuri() * enable #slider when config was saved * Active sliding via JS Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-07-04Dynamic OPML (#4407)Gravatar Alexandre Alapetite
* Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark
2022-06-21Better trim base_url (#4423)Gravatar Alexandre Alapetite
Avoid usual errors for instance with quotes, especially when provided through Docker / CLI
2022-06-19Initial support for PHP 8.2 (#4421)Gravatar Alexandre Alapetite
* Initial support for PHP 8.2 Using dev image `freshrss/freshrss:latest` https://github.com/FreshRSS/FreshRSS/pull/4420 * Deprecated string interpolation
2022-06-19Update all test dependencies (#4419)Gravatar Alexandre Alapetite
* Update all test dependencies * Remove old false-positive * Minor update lock files * Increase PHPStan memory for Fedora https://github.com/FreshRSS/FreshRSS/pull/4400#issuecomment-1159514197 * Require PHP8+ for tests Due to small changes of signature in `ob_implicit_flush` and `simplexml_load_string`, cf. https://github.com/FreshRSS/FreshRSS/pull/4123 * Missing lint in CSS files
2022-06-11Safer htmlspecialchars_utf8 (#4411)Gravatar Alexandre Alapetite
* Safer htmlspecialchars_utf8 #fix https://github.com/FreshRSS/FreshRSS/issues/4410 * Undefined variable
2022-05-23Custom logo HTML (#4369)Gravatar Alexandre Alapetite
* Custom logo HTML Add option for custom HTML logo/title in the main Web UI view. Can potentially be different per user. #fix https://github.com/FreshRSS/FreshRSS/pull/3830/files#r850472247 * logo_html in main config With new `./data/config.custom.php` to provide custom values before install * Docker documentation * whitespace * Auto relax CSP to allow images for HTML logo * Documentation
2022-05-19Remove HTTP Referer for HTML download (#4372)Gravatar Alexandre Alapetite
Having this header leads to errors from sites such as LinkedIn. The usage of this header is also decreasing. Finaly, we were not sending the actual Referer but just the same URL as the one being fetched. I suggest to remove for now, and see whether anyone needs it, in which case an option would be possible.
2022-05-16Allow CssXPath updates with composer (#4368)Gravatar Artur Weigandt
* Install CssXPath with composer * Fix code style in tests * fix pathnames for tests and linting * add irrelevant files to .gitignore * Alphabetic order * let composer sort the packages alphabetically Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-05-15fix preview (#4291)Gravatar maTh
* fix * Update extra.js * reorga the scripts * Update extra.js * Several fixes https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1125472321 * More fixes * Cleaning * fix pr 4291 * Reorganise some script functions * Remove unused popup-txt And associated function openPopupWithMessage * Fix archiving categories https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126924602 * Fix stats https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126983134 * Fix direct subscription E.g. http://localhost/i/?c=subscription&id=735 * Fix subscription add https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126991621 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-05-14Update to PHPMailer 6.6.0 with composer (#4329)Gravatar Artur Weigandt
* Install PHPMailer 6.5.1 with composer * Fix folder name for phpmailer * Update PHPMailer to v6.6.0, add LICENSE and README.md * remove composer and autoload.php after install/update * Fix path to PHPMailer for PHPStan * Remove lib/composer.lock, lock PHPMailer at version 6.6.0 * Improve PSR-4 autoloading for PHPMailer * Markdownlint ignore * Delete some obvious comments * ignores * Support composer update --no-autoloader * Automatic cleaning With rules based on https://github.com/PHPMailer/PHPMailer/blob/master/README.md#minimal-installation * Readme gitignore hint Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-05-12OPML export/import of some proprietary FreshRSS attributes (#4342)Gravatar Alexandre Alapetite
* OPML export/import of some proprietary FreshRSS attributes #fix https://github.com/FreshRSS/FreshRSS/issues/4077 And one of the TODOs of https://github.com/FreshRSS/FreshRSS/pull/4220 XPath options, CSS Selector, and action filters * Bump library patch version * OPML namespace + documentation * Add example
2022-05-09OPML relax error check for non-strict mode (#4343)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3967
2022-04-26Fix lazyimg single quotes (#4330)Gravatar Alexandre Alapetite
Little bug for cases with single quote in URL such as ```html <img src="123?format='jpg'" /> ``` Could probably be replaced by `loading="lazy"` in the future, and with a better DOM-aware method, for instance during SimplePie `add_attributes()`
2022-04-02Add HTTP_REMOTE_USER header for auth (#4063)Gravatar drosoCode
* add HTTP_REMOTE_USER header for auth * add ip whitelist for HTTP_REMOTE_USER header * add IPv6 support for header auth * fix formatting * A few fixes * Add some default trusted sources * Fix IPv6 doc * More standard header names Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-04-02SimplePie fix status_code type (#4301)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4299
2022-03-24Rename conflicting function (#4289)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4284
2022-03-23Fix handling of authors with ampersand & (#4287)Gravatar Alexandre Alapetite
Especially needed for HTML+XPath Web scraping as it makes the rest of the pipeline fail to handle special characters.
2022-03-22WebSub: Use hash instead of base64 to handle long URLs (#4282)Gravatar Alexandre Alapetite
* WebSub: Use hash instead of base64 to handle long URLs * Use 410 Gone (Part of the WebSub specification https://www.w3.org/TR/websub/ )
2022-03-22SimplePie fix parsing of HTTP Links (#4283)Gravatar Alexandre Alapetite
* 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-21Set feed error state when XPath does not match (#4275)Gravatar Alexandre Alapetite
Gives the ability to filter HTML+XPath feeds that are not working
2022-03-16Replace lib_phpQuery by PhpGt/CssXPath (#4261)Gravatar Alexandre Alapetite
https://github.com/PhpGt/CssXPath
2022-03-05Fix HTML base for get full content (#4260)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4252
2022-03-01Specific HTML load for lib_phpQuery.php (#4243)Gravatar Alexandre Alapetite
And reverts a less appropriate workaround for the same thing in https://github.com/FreshRSS/FreshRSS/pull/4220 Avoids XML errors when believing that a document might be XML/XHTML.