diff options
| author | Greg Roach <fisharebest@gmail.com> | 2014-09-28 18:33:22 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2014-09-28 18:33:22 +0100 |
| commit | f2f3a924b1c7ba0b55f727b0d4080487f04ef25b (patch) | |
| tree | 0af8a5ded0760d8ca47adcfaef4ca7bb48443244 /library/WT/Note.php | |
| parent | 8d31edab472e8b189c7062f5ad95ef43b05542a3 (diff) | |
| download | webtrees-f2f3a924b1c7ba0b55f727b0d4080487f04ef25b.tar.gz webtrees-f2f3a924b1c7ba0b55f727b0d4080487f04ef25b.tar.bz2 webtrees-f2f3a924b1c7ba0b55f727b0d4080487f04ef25b.zip | |
A note with no name cannot easily be accessed
Diffstat (limited to 'library/WT/Note.php')
| -rw-r--r-- | library/WT/Note.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/library/WT/Note.php b/library/WT/Note.php index 61af3e09ef..9591113c06 100644 --- a/library/WT/Note.php +++ b/library/WT/Note.php @@ -76,14 +76,16 @@ class WT_Note extends WT_GedcomRecord { $text = $this->getNote(); - switch($WT_TREE->preference('FORMAT_TEXT')) { - case 'markdown': - $text = WT_Filter::markdown($text); - $text = strip_tags($text); - break; - } + if ($text) { + switch ($WT_TREE->preference('FORMAT_TEXT')) { + case 'markdown': + $text = WT_Filter::markdown($text); + $text = strip_tags($text); + break; + } - list($text) = explode("\n", $text); - $this->_addName('NOTE', strlen($text) > 100 ? mb_substr($text, 0, 100) . WT_I18N::translate('…') : $text, $this->getGedcom()); + list($text) = explode("\n", $text); + $this->_addName('NOTE', strlen($text) > 100 ? mb_substr($text, 0, 100) . WT_I18N::translate('…') : $text, $this->getGedcom()); + } } } |
