Skip to content

Commit f72cfbc

Browse files
committed
Prevent ending up with an invalid QName starting with a colon
1 parent 62fb6f7 commit f72cfbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/QNameValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ public static function fromDocument(
174174
// Will return the default namespace (if any) when prefix is NULL
175175
$namespaceURI = $element->lookupNamespaceUri($namespacePrefix);
176176

177-
return new static('{' . $namespaceURI . '}' . $namespacePrefix . ':' . $localName);
177+
return new static('{' . $namespaceURI . '}' . ($namespacePrefix ? $namespacePrefix . ':' : '') . $localName);
178178
}
179179
}

0 commit comments

Comments
 (0)