Skip to content

Use typed access to request parameters - #5267

Merged
Alkarex merged 3 commits into
FreshRSS:edgefrom
Alkarex:typed-request-param
Apr 6, 2023
Merged

Alkarex merged 3 commits into
FreshRSS:edgefrom
Alkarex:typed-request-param

Conversation

@Alkarex

@Alkarex Alkarex commented Apr 6, 2023

Copy link
Copy Markdown
Member

This was a big source of mixed datatypes in many places

Contributes to #4112

This was a big source of mixed datatypes in many places
@Alkarex Alkarex added the System care Everything related to system care label Apr 6, 2023
@Alkarex Alkarex added this to the 1.22.0 milestone Apr 6, 2023
Comment thread lib/Minz/Request.php
* @param mixed $default default value, if no parameter is given
* @param bool $specialchars special characters
* @return mixed value of the parameter
* @deprecated use typed versions instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the previous method deprecated.
Still used in one location: FreshRSS_entry_Controller->readAction()

@Alkarex
Alkarex marked this pull request as draft April 6, 2023 00:48
@Alkarex
Alkarex marked this pull request as ready for review April 6, 2023 00:53
@Alkarex

Alkarex commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

@ColonelMoutarde would you feel like proofreading a bit here?

@Alkarex

Alkarex commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

Let's merge to avoid too many PR conflicts

@Alkarex
Alkarex merged commit 6c01e4e into FreshRSS:edge Apr 6, 2023
@Alkarex
Alkarex deleted the typed-request-param branch April 6, 2023 22:13
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Apr 13, 2023
@Alkarex Alkarex mentioned this pull request Apr 13, 2023
$shortcuts = Minz_Request::param('shortcuts');
if (false !== Minz_Request::param('load_default_shortcuts')) {
$shortcuts = Minz_Request::paramArray('shortcuts');
if (!Minz_Request::paramBoolean('load_default_shortcuts')) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Negation bug fixed in #5294

Alkarex added a commit that referenced this pull request Apr 13, 2023
$limits['max_feeds'] = Minz_Request::param('max-feeds', 16384);
$limits['max_categories'] = Minz_Request::param('max-categories', 16384);
$limits['cookie_duration'] = Minz_Request::param('cookie-duration', FreshRSS_Auth::DEFAULT_COOKIE_DURATION);
$limits['max_registrations'] = Minz_Request::paramInt('max-registrations') ?: 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants