Skip to content

Commit 66e3dd2

Browse files
committed
Avoid broken XML-output when no prefix is set (3)
1 parent 0e52ca8 commit 66e3dd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function toXML(DOMElement $parent): DOMElement
108108
{
109109
$parent->setAttributeNS(
110110
$this->getNamespaceURI(),
111-
($this->getNamespacePrefix() !== '')
111+
!in_array($this->getNamespacePrefix(), ['', null])
112112
? ($this->getNamespacePrefix() . ':' . $this->getAttrName())
113113
: $this->getAttrName(),
114114
$this->getAttrValue(),

0 commit comments

Comments
 (0)