Skip to content

Commit

Permalink
Add empty string check (#26)
Browse files Browse the repository at this point in the history
update example
  • Loading branch information
ayinloya authored Sep 4, 2023
1 parent 92a2c58 commit b149c5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/document_verification.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// The ID Document Information
$id_info = array(
'country' => '<2-letter country code>',
'id_type' => '<id type>'
'id_type' => '<id type | null>' // id_type is optional. If a job is submitted without id_type and the machine can't classify the document, we will reject the job
);

// Create image list
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function validateIdParams($id_params, $job_type)
if (!array_key_exists($key, $id_params)) {
throw new Exception($message);
}
if ($id_params[$key] === null) {
if ($id_params[$key] === null || $id_params[$key] === "") {
throw new Exception($message);
}
}
Expand Down

0 comments on commit b149c5f

Please sign in to comment.