MagicEnvelope called DOMDocument::loadXML statically
but apparently we shouldn't do this, despite recommended on https://secure.php.net/manual/en/domdocument.loadxml.php
This commit is contained in:
parent
961031bc28
commit
24b1e26406
|
@ -50,8 +50,8 @@ class MagicEnvelope
|
|||
*/
|
||||
public function __construct($xml=null) {
|
||||
if (!empty($xml)) {
|
||||
$dom = DOMDocument::loadXML($xml);
|
||||
if (!$dom instanceof DOMDocument) {
|
||||
$dom = new DOMDocument();
|
||||
if (!$dom->loadXML($xml)) {
|
||||
throw new ServerException('Tried to load malformed XML as DOM');
|
||||
} elseif (!$this->fromDom($dom)) {
|
||||
throw new ServerException('Could not load MagicEnvelope from DOM');
|
||||
|
|
Loading…
Reference in New Issue
Block a user