Ensure $note->getModified() never returns 1969, add getCleanTitle()

master
Skylar Ittner 6 years ago
parent 88b2146135
commit bc86fd0aa6

@ -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));

Loading…
Cancel
Save