Skip to content

Commit

Permalink
Merge pull request #6 from picklecillo/fix/no-body-warning
Browse files Browse the repository at this point in the history
handling no body on title:body arg
  • Loading branch information
craftzdog authored Nov 19, 2024
2 parents f1a0626 + 787e4f5 commit a12be41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ $password = getenv('password');
$inkdrop = new Inkdrop($host, $port, $username, $password);
$args = explode(":", $query, 2);
$title = $args[0];
$body = $args[1];
[$title, $body] = array_pad(explode(":", $query), 2, '');
$tags = getenv('defaultTags');
$notebook = getenv('defaultNotebook');
Expand Down
2 changes: 1 addition & 1 deletion src/inkdrop.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function create($title, $body, $notebook, $tags) {
"status" => "active",
"share" => "private",
"title" => trim($title),
"body" => trim($body) ?? '',
"body" => trim($body),
);

if (!empty($tags)) {
Expand Down

0 comments on commit a12be41

Please sign in to comment.