Restore previous state for libxml option
Whenever libxml_use_internal_errors() is called, the previous value for
it should be restored. This used to be the case in this piece of code,
but it was wrongly removed in e53bf5839b
,
which has the nasty side effect of making the Validator component test
suite break with this message:
Validation failed: No DTD found!
This commit is contained in:
parent
f88a79b550
commit
dde74aa8c9
@ -115,7 +115,7 @@ EOF
|
|||||||
return ['file' => $file, 'valid' => true];
|
return ['file' => $file, 'valid' => true];
|
||||||
}
|
}
|
||||||
|
|
||||||
libxml_use_internal_errors(true);
|
$internal = libxml_use_internal_errors(true);
|
||||||
|
|
||||||
$document = new \DOMDocument();
|
$document = new \DOMDocument();
|
||||||
$document->loadXML($content);
|
$document->loadXML($content);
|
||||||
@ -143,6 +143,9 @@ EOF
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libxml_clear_errors();
|
||||||
|
libxml_use_internal_errors($internal);
|
||||||
|
|
||||||
return ['file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors];
|
return ['file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user