File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 "minimum-stability" : " dev" ,
2121 "require" : {
2222 "php" : " ^7.1" ,
23- "ext-openssl" : " *"
23+ "ext-openssl" : " *" ,
24+ "ext-json" : " *"
2425 },
2526 "require-dev" : {
2627 "phpunit/phpunit" : " ^9.0"
Original file line number Diff line number Diff line change @@ -25,13 +25,13 @@ public function sign(JSignParam $params)
2525 $ this ->validation ($ params );
2626
2727 $ commandSign = $ this ->commandSign ($ params );
28- $ out = exec ($ commandSign , $ output );
29- if (is_array ($ output ))
30- $ output = $ output [count ($ output ) -1 ];
28+ exec ($ commandSign , $ output );
3129
30+ $ out = json_encode ($ output );
3231 $ messageSuccess = "INFO Finished: Signature succesfully created. " ;
33- $ isSigned = ($ output == $ messageSuccess || $ out == $ messageSuccess );
34- $ this ->throwIf (!$ isSigned , "Error to sign PDF. $ output " );
32+ $ isSigned = strpos ($ out , $ messageSuccess ) !== false ;
33+
34+ $ this ->throwIf (!$ isSigned , "Error to sign PDF. $ out " );
3535
3636 $ fileSigned = $ this ->fileService ->contentFile (
3737 $ params ->getTempPdfSignedPath (),
You can’t perform that action at this time.
0 commit comments