MDL-50907 antivirus: Make antivirus_exception message more general.

Since the scan can be run not only as a result of file uploading, the
language string should be more general.
This commit is contained in:
Ruslan Kabalin 2015-08-19 12:55:16 +01:00 committed by Andrew Nicols
parent 3451a05292
commit 8504673116
3 changed files with 6 additions and 2 deletions

View File

@ -27,4 +27,7 @@ $string['antiviruses'] = 'Antivirus plugins';
$string['antivirussettings'] = 'Manage antivirus plugins';
$string['configantivirusplugins'] = 'Please choose the antivirus plugins you wish to use and arrange them in order of being applied.';
$string['emailsubject'] = '{$a} :: Antivirus notification';
$string['virusfounduser'] = 'The file you have uploaded, {$a->filename}, has been scanned by a virus checker and found to be infected! Your file upload was NOT successful.';
$string['virusfound'] = '{$a->item} has been scanned by a virus checker and found to be infected!';
// Deprecated since Moodle 3.5.
$string['virusfounduser'] = 'The file you have uploaded, {$a->filename}, has been scanned by a virus checker and found to be infected! Your file upload was NOT successful.';

View File

@ -147,3 +147,4 @@ groupaddnewnote,core_notes
selectnotestate,core_notes
extendenrol,core
groupextendenrol,core
virusfounduser,core_antivirus

View File

@ -75,7 +75,7 @@ class manager {
if ($deleteinfected) {
unlink($file);
}
throw new \core\antivirus\scanner_exception('virusfounduser', '', array('filename' => $filename));
throw new \core\antivirus\scanner_exception('virusfound', '', array('item' => $filename));
}
}
}