Merge pull request #52 from cbotsikas/fix-php-support

Use array() instead of the short array syntax []
This commit is contained in:
Győrvári Gábor
2019-07-24 16:32:18 +02:00
committed by GitHub

View File

@@ -511,7 +511,7 @@ class MalwareScanner
} }
if ($this->outputFormat) { if ($this->outputFormat) {
$map = [ $map = array(
'%S' => $state, '%S' => $state,
'%T' => $ctime, '%T' => $ctime,
'%M' => $hash, '%M' => $hash,
@@ -519,9 +519,9 @@ class MalwareScanner
'%P' => $pattern, '%P' => $pattern,
'%C' => $comment, '%C' => $comment,
'%L' => $lineNumber, '%L' => $lineNumber,
]; );
} else { } else {
$map = [ $map = array(
'%S' => $state_color . '# ' . $state . $this->ANSI_OFF, '%S' => $state_color . '# ' . $state . $this->ANSI_OFF,
'%T' => $this->ANSI_BLUE . $ctime . $this->ANSI_OFF, '%T' => $this->ANSI_BLUE . $ctime . $this->ANSI_OFF,
'%M' => $this->ANSI_BLUE . $hash . $this->ANSI_OFF, '%M' => $this->ANSI_BLUE . $hash . $this->ANSI_OFF,
@@ -529,7 +529,7 @@ class MalwareScanner
'%P' => $state_color . '#' . $pattern . $this->ANSI_OFF, '%P' => $state_color . '#' . $pattern . $this->ANSI_OFF,
'%C' => $this->ANSI_BLUE . $comment . $this->ANSI_OFF, '%C' => $this->ANSI_BLUE . $comment . $this->ANSI_OFF,
'%L' => $lineNumber, '%L' => $lineNumber,
]; );
} }
if ($this->outputFormat) { if ($this->outputFormat) {
@@ -769,7 +769,7 @@ class MalwareScanner
} }
$content = gzdecode(file_get_contents($file)); $content = gzdecode(file_get_contents($file));
$this->combined_whitelist = []; $this->combined_whitelist = array();
$this->combined_whitelist_count = 0; $this->combined_whitelist_count = 0;
foreach (explode("\n", $content) as $line) { // faster than strtok, but needs more memory foreach (explode("\n", $content) as $line) { // faster than strtok, but needs more memory
if ($line) { if ($line) {