Skip to content

Commit

Permalink
Merge pull request #17 from open-sausages/pulls/message-sanitisation
Browse files Browse the repository at this point in the history
BUG Message sanitisiation
  • Loading branch information
Nathan committed Jun 1, 2020
2 parents a7bf376 + b8e847f commit f1dc321
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Tasks/ClamAVBaseTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Exception;
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\BuildTask;
use SilverStripe\ORM\DataList;
Expand Down Expand Up @@ -134,11 +135,11 @@ protected function log($messageOrDataObject, $type = '', Exception $exception =

switch ($type) {
case '':
DB::alteration_message($message);
DB::alteration_message(Convert::raw2xml($message));
break;

case 'created':
DB::alteration_message($message, 'created');
DB::alteration_message(Convert::raw2xml($message), 'created');
break;

case 'error':
Expand All @@ -148,12 +149,12 @@ protected function log($messageOrDataObject, $type = '', Exception $exception =
break;

case 'changed':
DB::alteration_message($message, 'changed');
DB::alteration_message(Convert::raw2xml($message), 'changed');
break;

case 'notice':
case 'warning':
DB::alteration_message($message, 'notice');
DB::alteration_message(Convert::raw2xml($message), 'notice');
break;

default:
Expand Down

0 comments on commit f1dc321

Please sign in to comment.