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) {
|
public function __construct($xml=null) {
|
||||||
if (!empty($xml)) {
|
if (!empty($xml)) {
|
||||||
$dom = DOMDocument::loadXML($xml);
|
$dom = new DOMDocument();
|
||||||
if (!$dom instanceof DOMDocument) {
|
if (!$dom->loadXML($xml)) {
|
||||||
throw new ServerException('Tried to load malformed XML as DOM');
|
throw new ServerException('Tried to load malformed XML as DOM');
|
||||||
} elseif (!$this->fromDom($dom)) {
|
} elseif (!$this->fromDom($dom)) {
|
||||||
throw new ServerException('Could not load MagicEnvelope from DOM');
|
throw new ServerException('Could not load MagicEnvelope from DOM');
|
||||||
|
Loading…
Reference in New Issue
Block a user