File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1313use function defined ;
1414use function file_exists ;
1515use function implode ;
16+ use function libxml_clear_errors ;
17+ use function libxml_use_internal_errors ;
1618use function libxml_get_errors ;
1719use function sprintf ;
1820use function trim ;
@@ -32,6 +34,9 @@ trait SchemaValidatableElementTrait
3234 */
3335 public static function schemaValidate (DOMDocument $ document ): DOMDocument
3436 {
37+ $ internalErrors = libxml_use_internal_errors (true );
38+ libxml_clear_errors ();
39+
3540 $ schemaFile = self ::getSchemaFile ();
3641 // Must suppress the warnings here in order to throw them as an error below.
3742 $ result = @$ document ->schemaValidate ($ schemaFile );
@@ -48,6 +53,9 @@ public static function schemaValidate(DOMDocument $document): DOMDocument
4853 ));
4954 }
5055
56+ libxml_use_internal_errors ($ internalErrors );
57+ libxml_clear_errors ();
58+
5159 return $ document ;
5260 }
5361
You can’t perform that action at this time.
0 commit comments