Skip to content

Commit

Permalink
praxisdigital/moodle-opgaver#501 - Updated filesize check
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikmillingpytlick committed Nov 6, 2024
1 parent bce1aac commit d7ebb8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d7ebb8a

Please sign in to comment.