From d7ebb8aacc8b9db4df4058e300013e1138a2c9a8 Mon Sep 17 00:00:00 2001 From: Frederik Milling Pytlick Date: Wed, 6 Nov 2024 08:15:08 +0100 Subject: [PATCH] praxisdigital/moodle-opgaver#501 - Updated filesize check --- lib.php | 3 ++- version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib.php b/lib.php index d18f9d8..b2a9556 100644 --- a/lib.php +++ b/lib.php @@ -1443,7 +1443,8 @@ function urkund_send_file_to_urkund($plagiarismfile, $plagiarismsettings, $file) return true; } - if ($file->get_filesize() > 100 * 1024 ** 2) { // File is larger than 100 MB, marking to large and skipping. + $filesize = (!empty($file->filepath)) ? filesize($file->filepath) : $file->get_filesize(); + if ($filesize > 100 * 1024 ** 2) { // File is larger than 100 MB, marking to large and skipping. mtrace("URKUND fileid:".$plagiarismfile->id. ' is to large, skipping...'); $plagiarismfile->statuscode = URKUND_STATUSCODE_TOO_LARGE; $DB->update_record('plagiarism_urkund_files', $plagiarismfile); diff --git a/version.php b/version.php index 36d8533..44a0561 100644 --- a/version.php +++ b/version.php @@ -27,7 +27,7 @@ /** @var object $plugin */ $plugin->component = 'plagiarism_urkund'; -$plugin->version = 2024103000; +$plugin->version = 2024110600; $plugin->requires = 2022041900; // Requires 4.0. $plugin->cron = 0; // Cron function no longer used. $plugin->maturity = MATURITY_STABLE;