Implement max length for input fields on the feedback page#1557
Implement max length for input fields on the feedback page#1557osma merged 1 commit intoNatLibFi:masterfrom
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1557 +/- ##
=========================================
Coverage 70.20% 70.20%
Complexity 1664 1664
=========================================
Files 32 32
Lines 4293 4293
=========================================
Hits 3014 3014
Misses 1279 1279 ☔ View full report in Codecov by Sentry. |
|
Thanks for the PR @rvdwxl ! Hardcoding the limit to 255 characters is a little ugly, but I think this is still an improvement, so this can be merged to Skosmos 2.x and included in the upcoming 2.17 release (probably the last one in the Skosmos 2.x) series. For Skosmos 3 I think we need a more detailed specification on how to handle this. I will open a separate issue about that shortly. |








Reasons for creating this PR
This PR adds a maximum input length to the "name", "email", and "subject" input fields on the feedback page, both to the frontend and backend. A maximum length was not previously implemented, and allows users to input very large strings either in the form, or by hijacking the POST-request.
Link to relevant issue(s), if any
Description of the changes in this PR
This PR imposes a limit of 255 characters to the "name", "email", and "subject" input fields on the feedback page; both in the frontend (feedback.twig, by using attribute "maxlength") and the backend (WebController, by using "substr").
Known problems or uncertainties in this PR
Checklist
.sr-onlyclass, color contrast)