Skip to content

Commit 6ee4f1d

Browse files
committed
Bug-fix.
Changelog excerpt: - The front-end signature information page reported the wrong counts for unidentified or other under the signature vendor or source counts; Fixed.
1 parent 0de1899 commit 6ee4f1d

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
5353
[2021.06.07; Maikuolan]: Since v3, the "repository backup locations" are kind of useless (not linked up with Composer, and only providing metapackage data, rather than all the attached repositories/packages). Removed those links from the front-end home page and v3 documentation accordingly.
5454

5555
[2021.06.08; Maikuolan]: Subtle aesthetic patch.
56+
57+
[2021.09.09; Bug-fix; Maikuolan]: The front-end signature information page reported the wrong counts for unidentified or other under the signature vendor or source counts; Fixed.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"require": {
1515
"php": ">=7.2.0",
1616
"maikuolan/common": "^2.7",
17-
"phpmussel/core": "^3.2",
17+
"phpmussel/core": "^3.2.2",
1818
"ext-pcre": "*"
1919
},
2020
"autoload": {

src/FrontEnd.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: Front-end handler (last modified: 2021.09.05).
11+
* This file: Front-end handler (last modified: 2021.09.09).
1212
*/
1313

1414
namespace phpMussel\FrontEnd;
@@ -2210,9 +2210,9 @@ private function signatureInformationHandler(string &$InfoRows, string &$SigInfo
22102210
continue;
22112211
}
22122212
$Class = substr($Data, 9, 1);
2213-
$Nibbles = $this->Scanner->splitNibble($Class);
2214-
$Class = !isset($Classes[$Nibbles[0]]) ? [] : $Classes[$Nibbles[0]];
2215-
$Totals['Files'][$File] = empty($Class[1]) ? substr_count($Data, ',') + 1 : preg_match_all('/' . $Class[1] . '\S+/', $Data);
2213+
$Nibbles = strlen($Class) ? $this->Scanner->splitNibble($Class) : [-1, -1];
2214+
$Class = $Classes[$Nibbles[0]] ?? [];
2215+
$Totals['Files'][$File] = empty($Class[1]) ? 0 : preg_match_all('/' . $Class[1] . '\S+/', $Data);
22162216
if (isset($Class[1])) {
22172217
$Totals['Classes'][$Class[0]] = isset($Totals['Classes'][$Class[0]]) ? $Totals['Classes'][$Class[0]] + $Totals['Files'][$File] : $Totals['Files'][$File];
22182218
}
@@ -2223,7 +2223,7 @@ private function signatureInformationHandler(string &$InfoRows, string &$SigInfo
22232223
if (!empty($Class[1])) {
22242224
foreach (['Vendors', 'SigTypes', 'Targets', 'MalwareTypes'] as $Sub) {
22252225
foreach ($Arr[$Sub] as $Key => $Pattern) {
2226-
$Counts = preg_match_all('/' . $Class[1] . $Pattern . '\S+/', $Data);
2226+
$Counts = preg_match_all('/' . $Class[1] . '(?:' . $Pattern . ')\S+/', $Data);
22272227
$Totals[$Sub][$Key] = isset($Totals[$Sub][$Key]) ? $Totals[$Sub][$Key] + $Counts : $Counts;
22282228
}
22292229
}

0 commit comments

Comments
 (0)