From d44854e07b6268f8ba541adc6a04a47cc87c54d5 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 13 Jan 2022 17:17:48 +0100 Subject: [PATCH] Remove unused require_once, die if touch fails --- trigger.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trigger.php b/trigger.php index 3de0538..979d54d 100644 --- a/trigger.php +++ b/trigger.php @@ -1,6 +1,5 @@ dirroot . '/backup/util/includes/backup_includes.php'); if (! function_exists('str_ends_with')) { function str_ends_with(string $haystack, string $needle): bool @@ -24,4 +23,6 @@ if (!has_capability('local/replication:replicate', $context)) { die("User not allowed to trigger replication!"); } -touch($directory . $id . "-" . $course->category . ".mew"); \ No newline at end of file +if (!touch($directory . $id . "-" . $course->category . ".mew")) { + die("Could not touch $directory$id-{$course->category}.mew"); +} \ No newline at end of file