mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-11 16:32:55 +00:00
Add support for SMS types
This commit is contained in:
@@ -60,7 +60,7 @@ class SmsController extends Controller {
|
||||
foreach ($smsDatas as &$sms) {
|
||||
if (!array_key_exists("_id", $sms) || !array_key_exists("read", $sms) ||
|
||||
!array_key_exists("date", $sms) || !array_key_exists("seen", $sms) ||
|
||||
!array_key_exists("mbox", $sms) ||
|
||||
!array_key_exists("mbox", $sms) || !array_key_exists("type", $sms)
|
||||
!array_key_exists("body", $sms) || !array_key_exists("address", $sms)) {
|
||||
$this->errorMsg = "Error: bad SMS entry";
|
||||
return false;
|
||||
@@ -71,6 +71,11 @@ class SmsController extends Controller {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["type"])) {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS type '%s'", $sms["type"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["mbox"]) && $sms["mbox"] != 0 && $sms["mbox"] != 1 &&
|
||||
$sms["mbox"] != 2) {
|
||||
$this->errorMsg = sprintf("Error: Invalid Mailbox ID '%s'", $sms["mbox"]);
|
||||
|
||||
Reference in New Issue
Block a user