Skip to content

Commit

Permalink
Fix breaking when spaces in log name (closes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
itismadness committed Dec 17, 2018
1 parent bd168e9 commit b38c25a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Logchecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,14 @@ private function legacy_parse() {
$GoodString = 'OK';
}

$CommandExists = Util::commandExists($Command);
$Out = shell_exec("{$Command} {$this->LogPath}");
if (Util::strposArray($Out, $BadStrings) !== false || strpos($Out, $GoodString) === false) {
$this->Checksum = false;
if (Util::commandExists($Command)) {
$Out = shell_exec("{$Command} ".escapeshellarg($this->LogPath));
if ($Out == null || Util::strposArray($Out, $BadStrings) !== false || strpos($Out, $GoodString) === false) {
$this->Checksum = false;
}
}
else {
$this->account("Could not find {$Command}, checksum not validated.", false, false, false, true);
}
}

Expand Down

0 comments on commit b38c25a

Please sign in to comment.