Commit Graph

720 Commits

Author SHA1 Message Date
Julien-Pierre Avérous
01576e6317 [API, extension] Use 'dateAdded()' to forge 'crawlTimeMsec' & 'timestampUsec' field in greader API. (#2773)
- Add the ability to customize 'dateAdded()', so an extension can change it if needed.
2020-01-18 11:58:46 +01:00
Marien Fressinaud
8eabc068c9 fix: #2701 Fix look of authors (#2771)
This fix makes the authors part of the "title item", so it's not
considered as another block. This is not perfect since authors will
disappear on small screens, but we can discuss of putting titles on
multi-lines (see https://github.com/FreshRSS/FreshRSS/issues/2344)
2020-01-17 08:11:05 +01:00
Julien-Pierre Avérous
9819a72293 Pass the entries to 'entry_before_display' extension hook (#2763)
* Pass the entries to 'entry_before_display' extension hook. - #2762

* Fix code-style.

* - Fix 'Whitespace found at end of line'.

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2020-01-16 13:02:05 +01:00
Alexis Degrugillier
13cf8265f0 Fix loader display in Dark theme (#2753)
Before, the default loader was used. It rendered poorly since it has a white
border.
Now, the theme loader is used.
2020-01-05 21:02:57 +01:00
Alexandre Alapetite
acc50df0ef Fix logging environment constants (#2745)
* Fix logging environment constants

* COPY_LOG_TO_SYSLOG was only working when Syslog was used
* FRESHRSS_ENV was not properly used to set logging level

* Simplify code

Always call `openlog()` even when it is not used

* Always specify syslog properties

https://github.com/FreshRSS/FreshRSS/pull/2745#discussion_r362207445

* $username is also needed further down

* No new line in syslog
2020-01-03 18:50:33 +01:00
Marien Fressinaud
03ddcf0772 fix: Fix undefined function _t on WebSub (#2743)
I published an article via WebSub, but I never received it. So I checked
my logs to find why and I found the following stacktrace:

```
29/Dec/2019:15:58:32 +0000 "POST /api/pshb.php" 500
NOTICE: PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function _t() in /path/app/Models/Category.php:83
Stack trace:
/path/app/Models/CategoryDAO.php(417): FreshRSS_Category->_id(1)
/path/app/Models/CategoryDAO.php(192): FreshRSS_CategoryDAO::daoToCategory(Array)
/path/app/Models/Feed.php(466): FreshRSS_CategoryDAO->searchById('1')
/path/app/Controllers/feedController.php(416): FreshRSS_Feed->cleanOldEntries()
/path/p/api/pshb.php(141): FreshRSS_feed_Controller::actualizeFeed(0, 'https://flus.io...', false, Object(SimplePie))
{main}
  thrown in /path/app/Models/Category.php on line 83
```

The `_t` function should be loaded with the Minz_Translate class, but
the latter isn't initialized on WebSub endpoint.

In my opinion, we should not have to care about this kind of detail of
implementation and it reveals a deeper architectural misconception, but
for now the fix should be enough. It’s quite difficult to reproduce
locally though.
2019-12-29 18:00:06 +01:00
romibi
518672fd27 Fix labels dropdown not scrollable after a while (#2727) 2019-12-28 15:01:55 +01:00
Alexis Degrugillier
1ce94136e0 Update navigation on empty feeds (#2687)
When using feed navigation, the previous behavior was to cycle through all
available feeds regardless of their content. To match the behaviour of the
first feed and last feed navigation shortcuts, the navigation now skips
empty feeds. Now it's consistent through out the application.
When using feed navigation with only empty feeds, the new behavior is to
cycle through all available feeds.

See #2385
2019-12-04 08:29:20 +01:00
Alexandre Alapetite
8b0f9fae9f Cookie same-site (#2630)
* Set-Cookie SameSite

* https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
* https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7
* https://blog.mozilla.org/security/2018/04/24/same-site-cookies-in-firefox-60/
* https://blog.chromium.org/2019/10/developers-get-ready-for-new.html

Set to Lax instead of Strict to allow linking to allow linking to FreshRSS sub-pages without having to log-in again
2019-11-05 18:11:38 +01:00
Marien Fressinaud
bba0b05655 Fix favorite display for "current" articles (#2634)
Favorite articles have, in most of the themes, a gold background to
distinguish them from the other articles. However, it can be distracting
to have such a background when reading the articles, so we should turn
them back to the "default" background when articles are opened (class
`.current`).

Bug introduced in e9ce27d8d9

Related PRs:

- https://github.com/FreshRSS/FreshRSS/pull/2477
- https://github.com/FreshRSS/FreshRSS/pull/2611
- https://github.com/FreshRSS/FreshRSS/pull/2612

Closes https://github.com/FreshRSS/FreshRSS/issues/2618
2019-11-05 16:42:29 +01:00
Alexandre Alapetite
6a317d876c API 64-bit ID as string (#2621)
Fix https://github.com/FreshRSS/FreshRSS/issues/2620
2019-11-02 00:46:58 +01:00
Frans de Jonge
2d3f7e7179 Fix unread styles (#2612)
* [fix] Flat unread CSS style

Same as #2611.

* [fix] Origine-Compact unread CSS style

Same as #2611.

* [fix] Swage unread CSS style

Same as #2611.
2019-10-28 09:58:52 +01:00
Frans de Jonge
7d9574e6f2 [fix] Origine unread CSS style (#2611)
Fixes #2604.
2019-10-27 21:59:36 +01:00
Alexandre Alapetite
fdfd8ce9be Workaround for MySQL limitation 1093 (#2586)
* Workaround for MySQL limitation 1093
https://github.com/FreshRSS/FreshRSS/pull/2335#issuecomment-545194606
including minor Travis fixes
2019-10-23 02:12:49 +02: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
21936c1373 Comply with LibreJS (#2576)
https://www.gnu.org/software/librejs/
https://addons.mozilla.org/firefox/addon/librejs/
Did not touch jquery.min.js because it is a third party script, which is regularly updated, and the add-on does not seem to block it enough to break our statitics page, which remains usable.
2019-10-20 22:10:24 +02:00
Offerel
ab4c3891ba Fix for broken read icon in Firefox (#2571)
* Fix for broken reading view icon in Firefox

* Update CREDITS.md

* Update CREDITS.md

* Fix for broken read icon in Firefox
2019-10-16 08:16:04 +02:00
Offerel
9dccfd23f4 Fix for broken reading view icon in Firefox (#2569) 2019-10-15 11:37:44 +02:00
Alexandre Alapetite
b20fddc330 Fix API i18n (#2565)
Fix https://github.com/FreshRSS/FreshRSS/issues/2564
2019-10-09 23:37:47 +02:00
Alexandre Alapetite
ec5f7ad554 Workaround for Firefox favicon glitch (#2543)
Observed in Firefox 69: the favicon is sometimes refreshed with an old
favicon that does not have the number of unread items on it. Seems to
depend on load speed.
2019-10-01 18:12:48 +02:00
Alexandre Alapetite
ef00513a81 Quick fix: API PDO visibility bug (#2545)
Introduced in https://github.com/FreshRSS/FreshRSS/pull/2522
2019-09-29 17:55:08 +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
rocka
1f3672fcc1 Optimize dynamic favicon for HiDPI screens (#2539)
This PR leveraging `window.devicePixelRatio` to generate high resolution favicons for HiDPI screens.
2019-09-28 12:10:51 +02:00
Alexandre Alapetite
28ab89146b API Reeder compatibility (#2526)
https://github.com/FreshRSS/FreshRSS/issues/2513
2019-09-18 13:03:53 +02:00
Marien Fressinaud
18efce3543 tec: Ignore theme folders starting by xTheme- (#2511) 2019-08-29 17:31:49 +02:00
Alexandre Alapetite
125a83efc9 IE11 / Edge keyboard compatibility (#2507)
https://github.com/FreshRSS/FreshRSS/pull/2506#issuecomment-523544684
2019-08-22 20:13:40 +02:00
ArthurHoaro
3f8804f54f Prevent window opener vulnerability with space shortcut (#2506)
* Prevent window opener vulnerability with space shortcut

This change fixes a vulnerability introduced by `window.open()` on untrusted sources. It reproduces the effect of `rel="noreferrer"` with JS.

Cross browser solution from: https://stackoverflow.com/a/40593743

## Reproduction

> tested with Firefox 68

  1. Add this RSS feed
  2. Open the 2nd link "À propos de la faille de sécurité liée à target="_blank" **using the space key shortcut**.
  3. Click on the first of three links "http://bookmarks.ecyseo.net"

Current behaviour: the FreshRSS tab changes.
Expected behaviour: no effect on FreshRSS

* Test for popup blockers
2019-08-21 21:14:22 +02:00
Alexandre Alapetite
fd33d92d41 Require PHP 5.5+ (#2495)
* Require PHP 5.5+

https://github.com/FreshRSS/FreshRSS/issues/2469#issuecomment-522255093
I think it would be reasonable to require PHP 5.5+ for the core of
FreshRSS after all.

As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the
most popular PHP application.

We would loose about 20% of the PHP servers according to
https://w3techs.com/technologies/details/pl-php/5/all but I expect this
number to drop fast after the release of CentOS 8 (CentOS accounts for
17% of Linux servers
https://w3techs.com/technologies/details/os-linux/all/all ).

Distributions:
* no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze,
Mageia, as all active versions have PHP > 7
* no impact on OpenSuze, Synology, as all active versions have PHP > 5.5
* we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch
(2017-06) - current is Debian 10 Buster
* we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05)
* we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released
soonish)

When dropping older versions, I can better like when it is for a good
reason, and there is actually one with PHP 5.5, namely generators
(yield) https://php.net/language.generators.overview which I consider
using.

* Version note for JSON.php

* hex2bin

* Update .travis.yml

Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2019-08-20 14:55:43 +02:00
Frans de Jonge
20c38d7083 [CI] Run stylelint (#2477)
* [CI] Run stylelint

Perform some basic CSS sanity checking and style enforcement.

I removed vendor prefixed linear-gradient and transform because those are from the IE9 era. With IE11 as a minimum and soon obsolete requirement it doesn't make much sense anymore.

* Remove as-link override

* Don't require newline after comment

* Also apply those newline rules to SCSS

* refine opening/closing braces, allow for single-line
2019-08-14 22:29:28 +02:00
Joris Kinable
cb31874085 Added option to display authors under article titles (#2487)
This feature is particularly useful to display authors underneath scientific articles.
2019-08-14 15:16:06 +02:00
Marien Fressinaud
7533676ae7 Add support for images to the ext.php endpoint (#2465) 2019-07-31 13:49:29 +02:00
Frans de Jonge
ad92518fe4 [CI] Run shellcheck and shfmt (#2454)
* [CI] Run shellcheck and shfmt

Cf. https://github.com/FreshRSS/FreshRSS/pull/2436#discussion_r305640019

* rename

* no need for disable anymore

* also remove leftover indentation flags even if it makes no difference to syntax checking

* define colors and reset before exit for local use
2019-07-22 16:07:40 +02:00
Nick Cross
1aa2af9752 Issue #2446 : Fix passing authentication headers (#2449)
* Issue #2446 : Fix passing authentication headers. Use CGIPassAuth is version is high enough

* Issue #2446 : Remove CGIPassAuth due to potential issues with AllowOverride rights.

* Tabs
2019-07-20 23:23:24 +02:00
Uncovery
25eada5bda Change to fix issues 2251 (#2301)
* Change to fix issues 2251

This is a proposed change to fix issue https://github.com/FreshRSS/FreshRSS/issues/2251

* Remove comments
2019-07-13 21:06:18 +02:00
Rosemary Le Faive
366ac2c57f Don't ignore br tags. (#2439) 2019-07-08 10:10:55 +02:00
Alexandre Alapetite
879312dbc2 jQuery 3.4.1 (#2424)
Only used for statistics graphs
2019-06-22 00:08:52 +02:00
Alexis Degrugillier
2decc82c3e Change category configuration (#2410)
* Change category configuration

Before, we had a drop-down list to interract on categories. It was not
working the same way as feeds.
Now, categories and feeds behave in a similar manner. At the moment,
there is no change in features but it will allow to expand them.

See #2369

* Minor whitespace
2019-06-21 08:42:06 +02:00
Patrick
6cc73d03c3 Make Aside sit on top of New Articles Popup (#2416)
Fixes #2379.
2019-06-21 08:06:22 +02:00
Alexandre Alapetite
037c385947 Fix API remove category (#2412)
Fix https://github.com/FreshRSS/FreshRSS/issues/2411
2019-06-16 18:59:50 +02:00
Alexandre Alapetite
2882752117 Merge pull request #2374 from aledeg/feature/print-css
Add theme to print page
2019-05-30 12:38:19 +02:00
Alexis Degrugillier
d5ea3e96ef Add theme to print page
Before, the printed page didn't have any usable CSS.
Now, it uses the css files available in the application. It means that
custom CSS can be add to target printed page.

See #2149
2019-04-16 18:50:32 +02:00
Alexandre Alapetite
c09b6c74b3 Forgotten colour 2019-04-16 12:05:07 +02:00
Alexandre Alapetite
a44f65892b More minimal patch 2019-04-16 12:04:22 +02:00
Alexandre Alapetite
ee9edae477 Fix Sage theme SVG refresh
https://github.com/FreshRSS/FreshRSS/issues/2375
2019-04-16 11:29:43 +02:00
Alexandre Alapetite
d26a49bc66 Fix API minor code syntax warning (#2362)
https://github.com/FreshRSS/FreshRSS/issues/2359#issuecomment-480620713
2019-04-07 21:50:26 +02:00
Alexandre Alapetite
aef3f8d71b Alow mix of auto read options (#2354)
Fix
https://github.com/FreshRSS/FreshRSS/pull/2349#issuecomment-480540126
2019-04-07 00:29:37 +02:00
Alexandre Alapetite
1b7cf6b035 Fix menu warning (#2353)
confirm is only for labels, not for feeds
2019-04-06 17:05:53 +02:00
Alexandre Alapetite
43e3a2d69d Fix autoremove again (#2352)
Fix https://github.com/FreshRSS/FreshRSS/pull/2349
2019-04-06 16:45:21 +02:00
Alexandre Alapetite
0a067dbcd4 Fix hide articles + batch option (#2349)
https://github.com/FreshRSS/FreshRSS/issues/2332
https://github.com/FreshRSS/FreshRSS/issues/2345
Re-introduces the instant-remove article.
Batch mark-as-read only used for fast actions like scroll and keyboard
shortcut for next/previous articles.
2019-04-06 15:51:39 +02:00
Alexandre Alapetite
74f92658b7 Fix for extensions on Windows (#2348)
https://github.com/FreshRSS/FreshRSS/issues/994
https://github.com/FreshRSS/FreshRSS/issues/2287
2019-04-06 14:07:19 +02:00