Ensure $note->getModified() never returns 1969, add getCleanTitle()
This commit is contained in:
parent
88b2146135
commit
bc86fd0aa6
@ -167,12 +167,21 @@ class Note {
|
|||||||
return $title;
|
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"
|
* Get the last modified date/time as "Y-m-d H:i:s"
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getModified(): 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");
|
||||||
}
|
}
|
||||||
return date("Y-m-d H:i:s", strtotime($this->modified));
|
return date("Y-m-d H:i:s", strtotime($this->modified));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user