summaryrefslogtreecommitdiffstats
path: root/lib/Db/Item.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Db/Item.php')
-rw-r--r--lib/Db/Item.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Db/Item.php b/lib/Db/Item.php
index 693b9417c..b30bd31cf 100644
--- a/lib/Db/Item.php
+++ b/lib/Db/Item.php
@@ -383,8 +383,10 @@ class Item extends Entity implements IAPI, \JsonSerializable
public function setAuthor(string $author = null): self
{
- $author = strip_tags($author);
-
+ if (!is_null($author)) {
+ $author = strip_tags($author);
+ }
+
if ($this->author !== $author) {
$this->author = $author;
$this->markFieldUpdated('author');
@@ -549,8 +551,10 @@ class Item extends Entity implements IAPI, \JsonSerializable
public function setTitle(string $title = null): self
{
- $title = trim(strip_tags($title));
-
+ if (!is_null($title)) {
+ $title = trim(strip_tags($title));
+ }
+
if ($this->title !== $title) {
$this->title = $title;
$this->markFieldUpdated('title');