Skip to content

Commit a044ff3

Browse files
committed
fix: excape password
The password need to be escaped to prevent error When the password have ' (quote) or other char that need to be escaped. Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent 9c6945d commit a044ff3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Sign/JSignService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ private function commandSign(JSignParam $params)
111111
}
112112
$this->throwIf(!file_exists($jSignPdf), 'Jar of JSignPDF not found on path: '. $jSignPdf);
113113

114-
return "$java -jar $jSignPdf $pdf -ksf $certificate -ksp '{$params->getPassword()}' {$params->getJSignParameters()} -d {$params->getPathPdfSigned()} 2>&1";
114+
$password = escapeshellarg($params->getPassword());
115+
return "$java -jar $jSignPdf $pdf -ksf $certificate -ksp {$password} {$params->getJSignParameters()} -d {$params->getPathPdfSigned()} 2>&1";
115116
}
116117

117118
private function javaCommand(JSignParam $params)

0 commit comments

Comments
 (0)