diff --git a/src/JasperPHP/JasperPHP.php b/src/JasperPHP/JasperPHP.php index da8e655..1414104 100644 --- a/src/JasperPHP/JasperPHP.php +++ b/src/JasperPHP/JasperPHP.php @@ -102,8 +102,10 @@ public function process($input_file, $output_file = false, $format = array("pdf" if( count($db_connection) > 0 ) { $command .= " -t " . $db_connection['driver']; - $command .= " -u " . $db_connection['username']; + if( isset($db_connection['username']) && !empty($db_connection['username']) ) + $command .= " -u " . $db_connection['username']; + if( isset($db_connection['password']) && !empty($db_connection['password']) ) $command .= " -p " . $db_connection['password'];