diff --git a/lib/Note.lib.php b/lib/Note.lib.php index 71887c9..619d838 100644 --- a/lib/Note.lib.php +++ b/lib/Note.lib.php @@ -167,12 +167,21 @@ class Note { return $title; } + public function getCleanTitle(): string { + $title = $this->getTitle(); + $title = str_replace("*", "", $title); + $title = str_replace("#", "", $title); + $title = str_replace("_", "", $title); + $title = str_replace("`", "", $title); + return trim($title); + } + /** * Get the last modified date/time as "Y-m-d H:i:s" * @return string */ public function getModified(): string { - if (empty($this->modified)) { + if (empty($this->modified) || strtotime($this->modified) == 0) { return date("Y-m-d H:i:s"); } return date("Y-m-d H:i:s", strtotime($this->modified));