From: Robert Kaiser Date: Sun, 2 Sep 2018 18:12:52 +0000 (+0200) Subject: deal with empty link value X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=da8e7efd5f6301bb07ac205f8dae87b6a25dcf43;p=php-utility-classes.git deal with empty link value --- diff --git a/classes/document.php-class b/classes/document.php-class index 5a60615..e98d292 100755 --- a/classes/document.php-class +++ b/classes/document.php-class @@ -335,7 +335,7 @@ class ExtendedDocument extends DOMDocument { } public function createElementLink($target, $value = '') { - $link = $this->createElement('a', $value); + $link = $this->createElement('a', (strlen($value) ? $value : $target)); $link->setAttribute('href', $target); // XXX: take care of & etc. in links return $link; }