fix some warnings from modern PHP versions
[php-utility-classes.git] / classes / document.php-class
index a0800f2889c4643a36164cedd901820fdc823978..ed688b6e38b3c7dd50b38f41e68bc9ebdfeae3cf 100755 (executable)
@@ -173,8 +173,7 @@ class ExtendedDocument extends DOMDocument {
   //   returns an ExtendedElement that is an HTML <img> with the given src and alt attributes (set to '' by default)
   //
   // public function createElementForm($action, $method, $name)
-  //   returns an ExtendedElement that is an HTML <div> that is a child of an HTML <form>
-  //   with the given action, method, and name
+  //   returns an ExtendedElement that is an HTML <form> with the given action, method, and name
   //
   // public function createElementInputHidden($name, $value)
   //   returns an ExtendedElement that is an HTML <input> of type 'hidden' with the given name and value
@@ -440,7 +439,7 @@ class ExtendedDocument extends DOMDocument {
   public function createElement($name, $value = '') {
     // Adding the $value in DOMDocument's createElement does NOT escape it, so override it and use appendText to support that.
     $aelem = parent::createElement($name);
-    if (strlen($value)) { $aelem->appendText($value); }
+    if (strlen($value ?? '')) { $aelem->appendText($value); }
     return $aelem;
   }