Skip to content

Commit 1779adf

Browse files
committed
fix(Bookmark): Remove mb_convert_encoding warning
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 539654f commit 1779adf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/Db/Bookmark.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function setTextContent(?string $content): void {
132132

133133
public function getTextContent(): string {
134134
// Remove non-utf-8 characters from string: https://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string
135-
return (string)mb_convert_encoding($this->textContent, 'UTF-8', 'UTF-8');
135+
return $this->textContent ? (string)mb_convert_encoding($this->textContent, 'UTF-8', 'UTF-8') : '';
136136
}
137137

138138
public function setHtmlContent(?string $content): void {
@@ -145,7 +145,7 @@ public function setHtmlContent(?string $content): void {
145145

146146
public function getHtmlContent(): string {
147147
// Remove non-utf-8 characters from string: https://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string
148-
return (string)mb_convert_encoding($this->htmlContent, 'UTF-8', 'UTF-8');
148+
return $this->htmlContent ? (string)mb_convert_encoding($this->htmlContent, 'UTF-8', 'UTF-8') : '';
149149
}
150150

151151
public function isWebLink() {

0 commit comments

Comments
 (0)