Commit Graph

4613 Commits

Author SHA1 Message Date
Alexis Degrugillier
e1ee58816b Add a file for each PDO class (#3297)
Before, we had 5 classes in the ModelPdo file. It was bad for 2 reasons.
The first reason is that it is considered bad practice to have multiple
class in one file. This is especially true when using autoloading. On top
of that it is less readable considering the size of the file. The second
reason is that so far we were lucky. Everytime we needed to access the
database, it was through the ModelPdo class which loads all the other
classes. If we want to access directly the connection, it wont be loaded.
On top of that, the system is configured to work on a single database,
but as we have every connection definition in a single file, all classes
were loaded at the same time. Thus using memory and processing time for
nothing.
Now, we have a file for each class. To work with autoloading, classes
were slightly renamed to match autoloading rules.
2020-12-28 16:44:08 +01:00
Alexandre Alapetite
ac0d90c100 Auto-renew cookie (#3287)
#fix https://github.com/FreshRSS/FreshRSS/issues/3169#issuecomment-685983797
Supplement https://github.com/FreshRSS/FreshRSS/pull/3170

When we get the long-term login cookie (i.e. when starting a new session), renew it at the same time for the same duration
2020-12-28 13:09:57 +01:00
Alexandre Alapetite
f7d69ad1de SimplePie Strip comments (#3288)
#fix https://github.com/FreshRSS/FreshRSS/issues/3282 (workaround an nginx configuration bug)

We do not need to keep HTML comments in RSS content.
2020-12-28 13:09:14 +01:00
Alexis Degrugillier
e93675e036 Fix tag management translation (#3292)
Before, feedback messages were not translated.
Now, they are.
2020-12-28 13:08:38 +01:00
Martin
6ecfc01c1f bump default logout from 30 days to 3 months (#3170)
* bump default logout from 30 to 365 days

* * Change cookie duration to constant
* Change cookie duration to three months

* use class

* use 90 days (otherwise login form says 91.3 days)

* change class

* also this works now

Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2020-12-26 23:40:24 +01:00
Alexandre Alapetite
2b0f93b013 Layout add subscription (#3289)
* Category first

I kept hitting the 'add' button for a category when adding a new feed

* Blanks

Mix of spaces
2020-12-26 20:30:49 +01:00
Alexandre Alapetite
4f74215199 Better OPML import of feeds in multiple categories (#3286)
#fix https://github.com/FreshRSS/FreshRSS/issues/3284
Helps https://github.com/FreshRSS/FreshRSS/issues/1989

In OPMLs files in which feeds are listed several times, favour the
version in a category instead of in no category.
2020-12-26 17:23:23 +01:00
Alexis Degrugillier
4abb30228b Fix user queries with labels (#3285)
Before user queries with labels were not translated. Actually, it was not
even processed.
Now those user queries are translated properly.

See #3215
2020-12-26 12:50:09 +01:00
Alexis Degrugillier
46cb89adf8 Extract autoloading process (#3283)
* Extract autoloading process

The process sits in its own file now to ease future improvements.

* Change the autoload process

Before, the autoload process was too restricted. It was really dependant on our
code tree. It was hard to add more classes to be loaded automatically. On top
of that, it did not support autoloading classes following the PSR-4 recommendation.

Now, the autoload process is more open. It supports partially the PSR-4 recommendation,
there is no specific code to load Minz classes or PHPMailer classes. This is the
starting point to reorganize the codebase to introduce long waiting changes as seen
in #789. It would be a nice to later rework the tree, rename classes, and add namespace
in a fashion that follows the PSR-4. Then specific FRSS workarounds in the autoload
could be dropped.
2020-12-26 12:47:39 +01:00
Alexandre Alapetite
abfbeb6b71 Cleaner use of session in install script (#3276)
Fix warning about session already started during install.
Refactor more code to use the same approach than in main FreshRSS.
Did not address all read accesses (not important) but did cover all
write accesses (important)
2020-12-22 17:37:19 +01:00
Alexandre Alapetite
48e0464e4b Prevent login before extra.js is loaded (#3275)
Disable submit button until extra.js with its crypto functions is
loaded.
2020-12-22 17:36:50 +01:00
Alexandre Alapetite
98b82842d5 Session compatibility PHP 7.1 and older (#3273)
#fix https://github.com/FreshRSS/FreshRSS/issues/3239
Reason: https://php.net/session-write-close used to return void and not
boolean before PHP 7.2
2020-12-12 15:59:37 +01:00
Alexandre Alapetite
da4121cb6c Docker image for oldest supported PHP version (#3274)
Add a Docker file, which can be used to test FreshRSS with our oldest
supported PHP version.

See
https://pkgs.alpinelinux.org/packages?name=php5&branch=v3.4&arch=x86_64

PHP 5.6.36-r0
2020-12-12 15:59:06 +01:00
thamerx
c700fd370c Fixes a minor jaggy motion of the sidebar. (#3266)
* Fixes a minor jaggy motion of the sidebar.

Fixes jaggy motion of the sidebar while scrolling on mobile clients.

I didn't try many values aside from %200 cause it worked very well from the first time. I was using a Galaxy S8+

* Update p/themes/base-theme/template.css

this one also works just as fine

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2020-11-26 20:53:03 +01:00
Alexandre Alapetite
08a5cf5946 Ensure maximum date int (#3259)
#fix https://github.com/FreshRSS/FreshRSS/issues/3258
2020-11-23 23:04:06 +01:00
Alwaysin
fdf40c95b9 Update link to News+ Google Reader extension (#3252)
* Remove News+ (Google Reader extension does not exist anymore)

* Remove News+ (Google Reader extension does not exist anymore)

* Update link to News+ Google Reader extension

* Update link to News+ Google Reader extension

* A few more links

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-11-12 11:52:52 +01:00
Alexandre Alapetite
6887ba0592 API fix continuation type (#3250)
#fix https://github.com/FreshRSS/FreshRSS/issues/3247
2020-11-12 09:36:33 +01:00
Marc Ole Bulling
a90274a1f4 Chang wording "Actualize" to "Update" (#3248)
* Fixed translation error (changed "Actualize" to "Update")

* Fix Travis

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-11-12 09:32:25 +01:00
Alexandre Alapetite
8dad63de02 Fix initI18n (#3249)
* Fix initI18n

#fix
https://github.com/FreshRSS/FreshRSS/issues/3246#issuecomment-725463337
#fix https://github.com/FreshRSS/FreshRSS/issues/3136

It was due to calling `initI18n()` before `FreshRSS_Context` is
intialised in some situations

Introduced by https://github.com/FreshRSS/FreshRSS/pull/3022
Will be better fixed when https://github.com/FreshRSS/FreshRSS/pull/3070
lands

* Fallback condition
2020-11-11 23:03:15 +01:00
Mejans
23015f26cc Update remember open categories (#3245) 2020-11-09 09:20:27 +01:00
Alexandre Alapetite
bb5b723def i18n ignore name of languages (#3240) 2020-11-04 21:50:46 +01:00
Prashant Tholia
ab1430ba67 Update CREDITS with a line for prashanttholia (#3244) 2020-11-04 21:50:27 +01:00
Maurice Schleußinger
886b8e484c Fixes #3052 (#3183)
Add note about Reeder and publication dates as footnote to README.
2020-11-02 23:25:16 +01:00
GuillaumePugnet
b00a06dc8d db username regex relaxed to allow @ (#3241)
Co-authored-by: Guillaume Pugnet <guillaume.pugnet@avanade.com>
2020-11-02 18:03:48 +01:00
Prashant Tholia
6f23999c7b Remember open categories (#3185)
* feature(normal) - Remember opened categories in the left menu

Session storage based implementation to remember opened categories in left menu

Issue Ref: #2248

* lib_phpQuery updates

* Updates covering feedback points and functionality fixes

* Feedback updates

* Revert "lib_phpQuery updates"

This reverts commit dcd23b9418.

* First review

Change variable name to "remember" instead of "open".
Start using localStorage instead of sessionStorage.
Simplify code.

* Simplify remember categories init function

Replace 'session' with 'local' in function names and comment

Set open categories CSS as same as when category is opened in 'active' unfold mode

* Remove URLSearchParams check in remember categories init function

* Delete open categories on login and logout

* JSHint check fix

* Second review

* Make new mode the default for new users
* Always open active category
* Reduce / simplify code

* i18n French

* Revert default value

Wait a bit more for this decision / change

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-11-02 12:03:16 +01:00
Fake4d
c2e3bc7cab i18n update for German - added missing de translations (#3237)
* Add DE Translation

* i18n update for German

* i18n update for German

* i18n update for German

* Fix ignore

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-11-01 19:12:58 +01:00
Alexandre Alapetite
e0b80e82e2 Docker LogFormat Alpine (#3235)
#fix https://github.com/FreshRSS/FreshRSS/issues/3233
In Alpine, we need to enable mod_logio.c to use %O. Revert to more
standard %b
https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#logformat
2020-10-22 00:04:10 +02:00
Alexandre Alapetite
a69a7531b6 Remember sidebar position (#3231)
#fix https://github.com/FreshRSS/FreshRSS/issues/3209
Extracted from https://github.com/FreshRSS/FreshRSS/pull/3185
2020-10-19 11:38:27 +02:00
Alexandre Alapetite
9ab05c7f67 Docker: Use Apache remoteip (#3226)
#fix https://github.com/FreshRSS/FreshRSS/issues/3224
Log the client remote IP instead of the local proxy IP
https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html
2020-10-16 09:25:43 +02:00
tonitonae
c6b843e04e Credits (#3229)
* Update FAQ with firewall issues.

* Update docs/en/users/07_Frequently_Asked_Questions.md

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

* Update credits with tonitonae's contributions.

Co-authored-by: tonitonae <tonitonae@zetmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-10-16 09:25:20 +02:00
tonitonae
fdfe6e7038 Update FAQ with firewall issues. (#3225)
* Update FAQ with firewall issues.

* Update docs/en/users/07_Frequently_Asked_Questions.md

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

Co-authored-by: tonitonae <tonitonae@zetmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-10-15 10:27:43 +02:00
Alexandre Alapetite
f33e261163 Fix sanitize feed description (#3222)
* Fix sanitize feed description

#fix https://github.com/FreshRSS/FreshRSS/issues/3221

* Simplification
2020-10-11 13:32:23 +02:00
Alexandre Alapetite
191cda42e6 Misc. minor
Whitespace...
2020-10-11 10:59:43 +02:00
Alexandre Alapetite
0319cc9d23 Minz allow parallel sessions (#3096)
* Minz allow parallel sessions

#fix https://github.com/FreshRSS/FreshRSS/issues/3093

* Array optimisation

* Array optimisation missing

* Reduce direct access to $_SESSION except in install process

* Fix session start headers warning

* Use cookie only the first time the session is started:
`PHP Warning:  session_start(): Cannot start session when headers
already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39`

* New concept of volatile session for API calls

Optimisation: do not use cookies or local storage at all for API calls
without a Web session
Fix warning:

```
PHP Warning:  session_destroy(): Trying to destroy uninitialized session
in Unknown on line 0
```

* Only call Minz_Session::init once in our index

It was called twice (once indirectly via FreshRSS->init())

* Whitespace

* Mutex for notifications

Implement mutex for notifications
https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809

* Typo

* Install script is not ready for using Minz_Session
2020-10-06 23:19:45 +02:00
Carl Cravens
3aed0b9553 tell git .png and .waff files are not text (#3211) 2020-10-06 23:17:01 +02:00
knasdk
e43b7ecd09 Use of existing tag name via input field (#3213)
* Use of existing tag name via input field

Use existing tag name, when tag name is typed into tag list's text field

* Indentation mistake

Just an indentation correction

* Final correction

Missed line 35.
2020-10-06 23:15:02 +02:00
Alexandre Alapetite
7652369359 Minz: Attach a notification to a request (#3208)
* Minz: Attach a notification to a request

Notifications should be attached to a request, not to a global session.
Fix
https://github.com/FreshRSS/FreshRSS/pull/3096#issuecomment-654891906
Prepare https://github.com/FreshRSS/FreshRSS/pull/3096

* Rename array

* Avoid string constants

Implement
https://github.com/FreshRSS/FreshRSS/pull/3208#issuecomment-703243863

* Improved logic

* Simplify storage

https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499511213

* Fix notification bug in configuration/system
2020-10-05 19:03:33 +02:00
Alexandre Alapetite
2f88b26780 Minz: support PHP8 lint (#3207)
* Minz: support PHP8 lint

Fix PHP8 Fatal error: Declaration of MinzPDO::query($statement) must be
compatible with PDO::query(string $query, ?int $fetch_mode = null, mixed
...$fetch_mode_args) in /FreshRSS/lib/Minz/ModelPdo.php on line 159
Errors parsing /FreshRSS/lib/Minz/ModelPdo.php

* Fix argument name

* Please phpcs in Travis
2020-10-03 15:47:58 +02: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:
aaad78e6da...692e8bc19b
2020-10-03 15:18:44 +02:00
Prashant Tholia
83166a9f5d lib_phpQuery support PHP 8 (#3186)
* Update to support PHP 8

Replaced create_function calls with anonymous functions in lib/lib_phpQuery.php

Ref Issue: #3082

* Remove commented code blocks

* White space

* More PHP8 fixes

Fix: Fatal error: Array and string offset access syntax with curly
braces is no longer supported in /FreshRSS/lib/lib_phpQuery.php on line
2174, etc.

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-10-03 14:26:31 +02:00
Andrew Rabert
e65544d39e Optimize images (#3184)
Used `oxipng --zopfli --opt max --strip all`
2020-10-03 13:42:18 +02:00
flo0627
6e610e501d Add toggle password visibility button on login form (#3205)
* Add password observer for login view and update Origine theme

* Update Alternative-Dark style

* Update BlueLagoon theme

* Update Dark theme

* Update Flat theme

* Update Screwdriver theme

* Update Origine-compact theme

* Update Pafat theme

* Coding style
2020-10-03 13:35:49 +02:00
Bartosz Taudul
f79194f4a6 Add Polish localization (#3190) 2020-09-29 14:20:40 +02:00
Frans de Jonge
faca82962c Silence new stylelint complaint (#3197)
Cf. https://github.com/FreshRSS/FreshRSS/pull/3196#issuecomment-699928812

```
p/themes/Ansum/_layout.scss
 42:4  ✖  Unexpected empty line before rule   rule-empty-line-before
p/themes/Mapco/_layout.scss
 42:4  ✖  Unexpected empty line before rule   rule-empty-line-before
```
2020-09-29 11:38:23 +02:00
Frans de Jonge
b93f42e951 [fix] Add text color to base theme (#3196) 2020-09-28 12:26:19 +02:00
Alexandre Alapetite
46e6340cc1 Start 1.17.1-dev 2020-09-24 10:13:05 +02:00
Alexandre Alapetite
ef5199eaad Release FreshRSS 1.17.0
https://github.com/FreshRSS/FreshRSS/issues/3181
1.17.0
2020-09-22 18:45:01 +02:00
Alexandre Alapetite
dbf4201173 Changelog, credits 2020-09-17 16:14:42 +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
bb9b166eb1 Fix CLI api_password (#3179)
* Fix CLI api_password

#fix https://github.com/FreshRSS/FreshRSS/issues/3177
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2675

* Update cli/_update-or-create-user.php

Co-authored-by: oupala <oupala@users.noreply.github.com>

Co-authored-by: oupala <oupala@users.noreply.github.com>
2020-09-17 09:43:39 +02:00