From d67a865bf02bd007dc69ff62d0bf96dc97efda4c Mon Sep 17 00:00:00 2001 From: Christos Botsikas Date: Wed, 24 Jul 2019 12:32:59 +0200 Subject: [PATCH] Use array() instead of the short array syntax [] Short array syntax [] was added in PHP 5.4 but the scanner should be able to work with [PHP >=5.2.0](https://github.com/scr34m/php-malware-scanner/blob/master/composer.json#L9). --- scan.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scan.php b/scan.php index cde2ccc..a66a503 100644 --- a/scan.php +++ b/scan.php @@ -511,7 +511,7 @@ class MalwareScanner } if ($this->outputFormat) { - $map = [ + $map = array( '%S' => $state, '%T' => $ctime, '%M' => $hash, @@ -519,9 +519,9 @@ class MalwareScanner '%P' => $pattern, '%C' => $comment, '%L' => $lineNumber, - ]; + ); } else { - $map = [ + $map = array( '%S' => $state_color . '# ' . $state . $this->ANSI_OFF, '%T' => $this->ANSI_BLUE . $ctime . $this->ANSI_OFF, '%M' => $this->ANSI_BLUE . $hash . $this->ANSI_OFF, @@ -529,7 +529,7 @@ class MalwareScanner '%P' => $state_color . '#' . $pattern . $this->ANSI_OFF, '%C' => $this->ANSI_BLUE . $comment . $this->ANSI_OFF, '%L' => $lineNumber, - ]; + ); } if ($this->outputFormat) { @@ -769,7 +769,7 @@ class MalwareScanner } $content = gzdecode(file_get_contents($file)); - $this->combined_whitelist = []; + $this->combined_whitelist = array(); $this->combined_whitelist_count = 0; foreach (explode("\n", $content) as $line) { // faster than strtok, but needs more memory if ($line) {