Commit Graph

26 Commits

Author SHA1 Message Date
Alexandre Alapetite
b1d24fbdb7 PHPStan 2.0 (#7131)
* PHPStan 2.0
fix https://github.com/FreshRSS/FreshRSS/issues/6989
https://github.com/phpstan/phpstan/releases/tag/2.0.0
https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md

* More

* More

* Done

* fix i18n CLI

* Restore a PHPStan Next test
For work towards PHPStan Level 10

* 4 more on Level 10

* fix getTagsForEntry

* API at Level 10

* More Level 10

* Finish Minz at Level 10

* Finish CLI at Level 10

* Finish Controllers at Level 10

* More Level 10

* More

* Pass bleedingEdge

* Clean PHPStan options and add TODOs

* Level 10 for main config

* More

* Consitency array vs. list

* Sanitize themes get_infos

* Simplify TagDAO->getTagsForEntries()

* Finish reportAnyTypeWideningInVarTag

* Prepare checkBenevolentUnionTypes and checkImplicitMixed

* Fixes

* Refix

* Another fix

* Casing of __METHOD__ constant
2024-12-27 12:12:49 +01:00
Luc SANCHEZ
15745d42b7 Upgrade code to php 8.1 (#6748)
* revert
Fix code indentation
Fix code

Upgrade code to php 8.1

* fix remarques

* code review

* code review

* code review

* Apply suggestions from code review

* code review

* Fixes

* Many remainging updates of array syntax

* Lost case 'reading-list'

* Uneeded PHPDoc

---------

Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-11-28 17:11:04 +01:00
Alexandre Alapetite
783fe19baa Remove dependency to exif extension (#6624)
* Remove dependency to exit extension
fix https://github.com/FreshRSS/FreshRSS/issues/6573

* Fix return
2024-07-17 17:33:17 +02:00
Luc SANCHEZ
f99c8d5f54 Modernize code to php7.4 (#6043)
* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Consistency

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-06-05 22:04:06 +02:00
Luc SANCHEZ
30c7a61a9b Use strict_types (#5830)
* Little's optimisations and booleans in conditions

* Apply strict type

* Apply strict type

* Apply strict type

* Fix multiple bugs with PHP 8.2 and 8.3

* Many declares missing, more errors fixed

* Apply strict type

* Another approach

* Stronger typing for Minz_Session

* Fix case of SQLite

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-11-16 22:43:00 +01:00
Alexandre Alapetite
f3760f138d Complete PHPStan Level 6 (#5305)
* Complete PHPStan Level 6
Fix https://github.com/FreshRSS/FreshRSS/issues/4112
And initiate PHPStan Level 7

* PHPStan Level 6 for tests
* Use phpstan/phpstan-phpunit
* Update to PHPStan version 1.10

* Fix mixed bug

* Fix mixed return bug

* Fix paginator bug

* Fix FreshRSS_UserConfiguration

* A couple more Minz_Configuration bug fixes

* A few trivial PHPStan Level 7 fixes

* A few more simple PHPStan Level 7

* More files passing PHPStan Level 7
Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251

* A few more PHPStan Level 7 preparations

* A few last details
2023-04-17 08:30:21 +02:00
Luc SANCHEZ
4f078958b5 Fix phpstan level 9 error for f.php and lib/favicons.php (#5263)
* Fix phpstan level 9 error

* Fix phpstan level 9 error

* Remarque's from Alkarex

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-04-05 22:28:34 +02:00
Alexandre Alapetite
4f316b2ed3 PHPStan level 9 for ./p/ and lib_rss.php (#5049)
And app/FreshRSS.php
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-01-29 18:53:51 +01:00
Pablo Caro
138d9ca658 Return the correct Content-Type for SVG favicons (#3032)
* Return the correct Content-Type for SVG favicons

* Use mime_content_type to check file type

* Use tab instead of spaces

* Remove extra blank lines

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

* Update f.php

* Better obey HTTP/1.1 304 Not Modified rules about headers https://tools.ietf.org/html/rfc2616#section-10.3.5
* Do not fail if the optional `fileinfo` is not available
* Handle more cases such as PNG, GIF, BMP...

* Add Content-Type for default favicon

* Do not repeat HTTP headers in HTTP 304 response

According to https://tools.ietf.org/html/rfc2616#section-10.3.5 it is better not to repeat HTTP headers in a HTTP 304 Not Modified response

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-06-06 23:29:46 +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
ColonelMoutarde
34d8be086c Better rand() (#1977)
http://php.net/manual/en/function.mt-rand.php

from php Doc

"Many random number generators of older libcs have dubious or unknown characteristics and are slow. The mt_rand() function is a drop-in replacement for the older rand(). It uses a random number generator with known characteristics using the » Mersenne Twister, which will produce random numbers four times faster than what the average libc rand() provides. "
2018-08-23 19:57:08 +02:00
Alexandre Alapetite
52d0988655 Use __DIR__ for relative include and require
For uniformity, and to avoid having PHP searching in include_path.
http://php.net/manual/function.include.php
https://github.com/FreshRSS/FreshRSS/pull/1715
https://github.com/FreshRSS/FreshRSS/pull/1711#issuecomment-350581350
2017-12-11 21:11:34 +01:00
Alexandre Alapetite
44c9ae51c4 Rewriten Favicon library using cURL
Reduce the number of requests, more robust, many more cases working,
reduced code
2017-04-23 14:06:37 +02:00
Alexandre Alapetite
e8d1a6dcc9 Cron refresh favicons
Related to
https://github.com/FreshRSS/FreshRSS/issues/1181
https://github.com/FreshRSS/FreshRSS/issues/1298
2016-10-12 15:47:04 +02:00
Alexandre Alapetite
c64918f839 Randomize favicon refresh
https://github.com/FreshRSS/FreshRSS/issues/1298
2016-10-12 09:49:38 +02:00
Alexandre Alapetite
b5ffa8cb47 Auto-refresh favicons
Every 15 days. https://github.com/FreshRSS/FreshRSS/issues/1181
2016-10-07 19:50:59 +02:00
Alexandre Alapetite
6248246735 Adjust caching for favicon with errors 2016-04-23 21:48:37 +02:00
Marien Fressinaud
f5043dbf71 Serve HTTP cache for default favicon + better headers
See da7d34d2ef (commitcomment-9439610)
2015-01-26 14:49:24 +01:00
Marien Fressinaud
da7d34d2ef Default favicon served with HTTP code 200
Fix https://github.com/FreshRSS/FreshRSS/issues/760
2015-01-26 13:02:47 +01:00
Marien Fressinaud
7584364a4c Fix behaviour when favicon url is not found
If url is not find, we copy default favicon into favicon dir so at the next
try, we don't search the url again.

See https://github.com/FreshRSS/FreshRSS/issues/290
See https://github.com/FreshRSS/FreshRSS/issues/727
2014-12-29 11:56:22 +01:00
Marien Fressinaud
ea79466582 Fix typo coding style
See https://github.com/FreshRSS/FreshRSS/issues/290
2014-12-29 11:46:01 +01:00
Marien Fressinaud
4f1fc70f87 Change favicon getter behaviour
- Use Favicon library
- Fix coding style
- Change default favicon

Fix https://github.com/FreshRSS/FreshRSS/issues/290
2014-12-29 11:44:25 +01:00
Alexandre Alapetite
3cff96fae3 Corrige problème favicons sous Nginx
https://github.com/marienfressinaud/FreshRSS/issues/364
2014-01-12 16:27:35 +01:00
Alexandre Alapetite
2c57e7254d Favicons : test pour améliorer le cache HTTP
Test d'utilisation de PATH_INFO plutôt que QUERY_STRING pour améliorer
la mise en cache.
À tester sur différents serveurs
2013-12-26 20:11:18 +01:00
Alexandre Alapetite
574d37bddc Favicons compatibles multi-utilisateurs
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
2013-12-26 19:58:17 +01:00
Alexandre Alapetite
58300c36ad Cookie : sous-répertoire pour index (changements de répertoires !)
Implémente https://github.com/marienfressinaud/FreshRSS/issues/333
/public/ est renommé /p/
/public/index.php est déplacé dans /p/i/index.php
Le cookie de session est limité à /p/i/
2013-12-26 01:56:58 +01:00