Skip to content

Commit d9065c7

Browse files
committed
Prevent handle invalid output
Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent e29b53b commit d9065c7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Sign/JSignService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public function getVersion(JSignParam $params)
6262

6363
$command = "$java -jar $jSignPdf --version";
6464
\exec($command, $output);
65+
if (empty($output) || strpos($output[0], 'version') === false) {
66+
return '';
67+
}
6568
return explode('version ', $output[0])[1];
6669
}
6770

0 commit comments

Comments
 (0)