Skip to content

Commit 2a7d80f

Browse files
committed
Slightly tweak YAML method.
1 parent c165721 commit 2a7d80f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sigtool.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* SigTool v0.2.0 (last modified: 2018.01.20).
3+
* SigTool v0.2.1 (last modified: 2018.06.20).
44
* Generates signatures for phpMussel using main.cvd and daily.cvd from ClamAV.
55
*
66
* Package location: GitHub <https://github.com/phpMussel/SigTool>.
@@ -89,13 +89,11 @@ public function read(string $In, &$Arr, int $Depth = 0)
8989
$Key = $Value = $SendTo = '';
9090
$TabLen = $SoL = 0;
9191
while ($SoL !== false) {
92-
if (($EoL = strpos($In, "\n", $SoL)) === false) {
93-
$ThisLine = substr($In, $SoL);
94-
} else {
95-
$ThisLine = substr($In, $SoL, $EoL - $SoL);
96-
}
92+
$ThisLine = (
93+
($EoL = strpos($In, "\n", $SoL)) === false
94+
) ? substr($In, $SoL) : substr($In, $SoL, $EoL - $SoL);
9795
$SoL = ($EoL === false) ? false : $EoL + 1;
98-
$ThisLine = preg_replace(["/#.*$/", "/\x20+$/"], '', $ThisLine);
96+
$ThisLine = preg_replace(['/#.*$/', '/\s+$/'], '', $ThisLine);
9997
if (empty($ThisLine) || $ThisLine === "\n") {
10098
continue;
10199
}

0 commit comments

Comments
 (0)