mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-06 06:46:25 +02:00
add limit check to size of sms
This commit is contained in:
parent
99349a35c5
commit
11b481aebd
6 changed files with 29 additions and 3 deletions
|
@ -309,6 +309,16 @@ namespace controllers\publics;
|
|||
return $this->json($return);
|
||||
}
|
||||
|
||||
if (mb_strlen($text) > \models\Scheduled::SMS_LENGTH_LIMIT)
|
||||
{
|
||||
$return = self::DEFAULT_RETURN;
|
||||
$return['error'] = self::ERROR_CODES['INVALID_PARAMETER'];
|
||||
$return['message'] = self::ERROR_MESSAGES['INVALID_PARAMETER'] . ' : text must be less than ' . \models\Scheduled::SMS_LENGTH_LIMIT . ' char.';
|
||||
$this->auto_http_code(false);
|
||||
|
||||
return $this->json($return);
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::validate_date($at, 'Y-m-d H:i:s'))
|
||||
{
|
||||
$return = self::DEFAULT_RETURN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue