1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-06 23:46:18 +00:00

Validate smsCount and smsDatas field

This commit is contained in:
Loic Blot 2017-08-23 22:26:07 +02:00
parent fa2685f865
commit f7da068505

View File

@ -104,6 +104,16 @@ class ApiController extends Controller {
* @return bool
*/
private function checkPushStructure ($smsCount, $smsDatas) {
if ($smsCount === NULL) {
$this->errorMsg = "Error: smsCount field is NULL";
return false;
}
if ($smsDatas === NULL) {
$this->errorMsg = "Error: smsDatas field is NULL";
return false;
}
if ($smsCount != count($smsDatas)) {
$this->errorMsg = "Error: sms count invalid";
return false;