Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix feedback form limit php81 deprecation warning #1567

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

osma
Copy link
Member

@osma osma commented Dec 5, 2023

Reasons for creating this PR

Follow-up fix to PR #1566 to address PHP 8.1 deprecation warnings. That PR used substr for truncation in a way that could trigger deprecation warnings when null values were encountered. This PR instead adds a maxlimit parameter to the Request.getQueryParamPOST method and uses that instead of plain substr, avoiding the problem.

Link to relevant issue(s), if any

Description of the changes in this PR

  • support maxlimit parameter in Request.getQueryParamPOST
  • add unit tests to verify above
  • switch WebController to use getQueryParamPost with maxlimit instead of plain substr

Known problems or uncertainties in this PR

n/a

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added the bug label Dec 5, 2023
@osma osma added this to the 2.17 milestone Dec 5, 2023
@osma osma self-assigned this Dec 5, 2023
Copy link

codecov bot commented Dec 5, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (3b9489a) 70.22% compared to head (46ea133) 70.32%.

Files Patch % Lines
controller/WebController.php 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1567      +/-   ##
============================================
+ Coverage     70.22%   70.32%   +0.10%     
- Complexity     1665     1667       +2     
============================================
  Files            32       32              
  Lines          4295     4300       +5     
============================================
+ Hits           3016     3024       +8     
+ Misses         1279     1276       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma merged commit e116774 into master Dec 5, 2023
12 of 15 checks passed
@osma osma deleted the fix-feedback-form-limit-php81-deprecation-warning branch December 5, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant