From e8838f35edeb4ca88b2ba9d23bc7356d13e489e3 Mon Sep 17 00:00:00 2001 From: Jane Adelmann Date: Wed, 4 May 2022 21:03:11 +0300 Subject: [PATCH] Do not send empty filter values --- classes/plagiarism_pchkorg_api_provider.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/plagiarism_pchkorg_api_provider.php b/classes/plagiarism_pchkorg_api_provider.php index 3830c0f..89e686c 100644 --- a/classes/plagiarism_pchkorg_api_provider.php +++ b/classes/plagiarism_pchkorg_api_provider.php @@ -193,7 +193,9 @@ class plagiarism_pchkorg_api_provider { $body .= $this->get_part('skip_percentage_words_validation', '1', $boundary); $body .= $this->get_part('lms', 'moodle', $boundary); foreach ($filters as $filtername => $filtervalue) { - $body .= $this->get_part($filtername, $filtervalue, $boundary); + if ($filtervalue !== null) { + $body .= $this->get_part($filtername, $filtervalue, $boundary); + } } $body .= $this->get_file_part('content', $content, $mime, $filename, $boundary); $body .= '--' . $boundary . '--' . $eol; @@ -380,7 +382,9 @@ class plagiarism_pchkorg_api_provider { $body .= $this->get_part('attachment_id', $attachmentid, $boundary); $body .= $this->get_part('lms', 'moodle', $boundary); foreach ($filters as $filtername => $filtervalue) { - $body .= $this->get_part($filtername, $filtervalue, $boundary); + if ($filtervalue !== null) { + $body .= $this->get_part($filtername, $filtervalue, $boundary); + } } $body .= $this->get_file_part('text', $content, $mime, $filename, $boundary); $body .= '--' . $boundary . '--' . $eol;