aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/handler.php2
-rw-r--r--editservice.php4
-rw-r--r--restorebackup.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/classes/handler.php b/classes/handler.php
index 47a44f3..da41856 100644
--- a/classes/handler.php
+++ b/classes/handler.php
@@ -54,7 +54,7 @@ class handler {
public static function events($event) {
$data = $event->get_data();
- if ($callbacks = local_webhooks_get_list_records()) {
+ if (!empty($callbacks = local_webhooks_get_list_records())) {
foreach ($callbacks as $callback) {
self::handler_callback($data, $callback);
}
diff --git a/editservice.php b/editservice.php
index de99556..aa3efb8 100644
--- a/editservice.php
+++ b/editservice.php
@@ -50,7 +50,7 @@ if ($mform->is_cancelled()) {
/* Getting the data */
$servicerecord = new stdClass();
-if ($editing = (bool) $serviceid) {
+if (($editing = (bool) $serviceid) === true) {
$servicerecord = local_webhooks_get_record($serviceid);
if (is_array($servicerecord->events)) {
@@ -69,7 +69,7 @@ if ($editing = (bool) $serviceid) {
}
/* Processing of received data */
-if ($data = $mform->get_data()) {
+if (!empty($data = $mform->get_data())) {
if (is_array($data->events)) {
$events = array();
diff --git a/restorebackup.php b/restorebackup.php
index 2c0cb39..db052f9 100644
--- a/restorebackup.php
+++ b/restorebackup.php
@@ -45,7 +45,7 @@ if ($mform->is_cancelled()) {
}
/* Processing the received file */
-if ($data = $mform->get_data()) {
+if (!empty($data = $mform->get_data())) {
$content = $mform->get_file_content('backupfile');
local_webhooks_restore_backup($content);
redirect($managerservice, new lang_string('restorefinished', 'moodle'));