Opened 4 years ago
Last modified 11 months ago
#10377 new defect (bug)
Comment fields should have max lengths
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Comments | Version: | 2.8 |
| Severity: | normal | Keywords: | 'sql exception' comments |
| Cc: | hellokane@… |
Description
Hello, I don't know if exactly it's a bug or use javascript validation, but i think so there's no
treatment for this, or was fix in the new version.
In the section of comments(Wordpress 2.8), we can insert how many characheters we wants, generating an SQL Exception and breaking the all system.
The solution is simple, use the property maxlenght in the tag
<input /> e limit the characters if will be send to database.
Change History (5)
also note, That MySQL should actually truncate the data if its longer, not throw an error..
Replying to dd32:
... so there's a limit of 65,535 characters in a comment at present.. Perhaps the comment handler should throw a error upon a longer comment.
There's some basic back-end validation already (duplicate comments, non-empty name and email, etc.). Adding max length for all comment fields should be trivial.
Actually this may be good for most POST requests in the admin including AJAX.
- Summary changed from Problem in comments! to Comment fields should have max lengths

That doesnt stop people from directly posting the data anyway..
The comment_content field is a TEXT field:
so theres a limit of 65,535 characters in a comment at present.. Perhaps the comment handler should throw a error upon a longer comment.