Page 1 of 1

How To Stop People From Breaking Message Limit

Posted: Mon Jan 11, 2010 10:10 am
by SupportCenter
I used the code that you told me about. When I test the code out, I wasnt able to get passed the 300 word limit. However, I got people that are exceeding the 300 word limit and rambling on in the message field. Is there some how they are bypassing it?

$message=hesk_input($_POST['message']) or $hesk_error_buffer[]=$hesklang['enter_message'];


--After the line above add the following below---

}
if (strlen($message) > 300)
{
$hesk_error_buffer[]='Your message is too long, limit it to 300 chars.';

Posted: Mon Jan 11, 2010 2:47 pm
by Klemen
That should work for posting a new ticket (customer side only), if you wish to limit reply lenght as well you should add similar code into reply_ticket.php:

Code: Select all

if (strlen($message) > 300) 
{ 
hesk_error('Your message is too long, limit it to 300 chars.');
}

Posted: Mon Jan 11, 2010 8:15 pm
by SupportCenter
Where does it get submitted in the reply_ticket.php file. I tried to insert it after the first line of code and did a test and it didnt work.

Posted: Tue Jan 12, 2010 11:54 am
by Klemen
Below

Code: Select all

$message=hesk_input

Posted: Wed Feb 17, 2010 3:50 am
by SupportCenter
I placed the code right after the line statement. It gives me an error that I can only have one ticket submitted at a time. When the code is removed the tickets work fine.

Posted: Wed Feb 17, 2010 9:22 pm
by Klemen
It gives me an error that I can only have one ticket submitted at a time
There is no such error in Hesk, it must be a customization you did?

Posted: Wed Feb 17, 2010 11:01 pm
by SupportCenter
I found the error. In the script you gave me a while back ago to only have a person allowed 1 ticket at a time. There was a >=, the variable has to be >=2 not >=1 to not allow a buyer to open up mutliple tickets. The whole time it was set to 1.

Mysteriously it worked all this time until it came to modify the reply characters allowed limit. But I figured it out last night via trial and error. Thanks again.