deal with empty link value
authorRobert Kaiser <kairo@kairo.at>
Sun, 2 Sep 2018 18:12:52 +0000 (20:12 +0200)
committerRobert Kaiser <kairo@kairo.at>
Sun, 2 Sep 2018 18:12:52 +0000 (20:12 +0200)
classes/document.php-class

index 5a60615b7189eac910f8f245ce4bad86954eaf10..e98d292a134c8f256c5c60f6c6f0ea3372b5fb5e 100755 (executable)
@@ -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;
   }