Script URL:
Version of script: Hesk 2.8.2 + Mods For Hesk 2018.2.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
The "subject" input has a maxlength of 70 characters and "subject" column is of datatype VARCHAR(70). When submitting a ticket where the subject contains characters that are encoded (such as " or &), it can result in MySQL error "Data too long for column 'subject' at row 1", in which case the user sees a general MySQL error message. An example subject is Testing what would happen when the subject has "double quotes" in it.
Should there be more of a "buffer" between the maxlength and the MySQL length? Or should the inputs be validated (encode the input and calculate length) before inserting them to database to avoid MySQL errors?
Encoded characters may cause ticket subject to be too long
Moderator: mkoch227
-
- Posts: 2
- Joined: Fri Oct 19, 2018 7:34 am
Re: Encoded characters may cause ticket subject to be too long
Good point.
The subject is limited to 70 chars to keep it short and to the point. I will make sure the next version increases subject length in the database and truncates the data before sending it to MySQL.
As a temporary solution that should work in most practical applications, you can manually execute this query in your database:
The subject is limited to 70 chars to keep it short and to the point. I will make sure the next version increases subject length in the database and truncates the data before sending it to MySQL.
As a temporary solution that should work in most practical applications, you can manually execute this query in your database:
Code: Select all
ALTER TABLE `hesk_tickets` CHANGE `subject` `subject` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '';
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 2
- Joined: Fri Oct 19, 2018 7:34 am
Re: Encoded characters may cause ticket subject to be too long
Thanks!
We already made a temporary increase for the column length to fix those problems.
We already made a temporary increase for the column length to fix those problems.