diff --git a/info.plist b/info.plist index 6092680..fde79af 100644 --- a/info.plist +++ b/info.plist @@ -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'); diff --git a/src/inkdrop.php b/src/inkdrop.php index eb94e59..14b9e20 100644 --- a/src/inkdrop.php +++ b/src/inkdrop.php @@ -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)) {