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 13
13
use function defined ;
14
14
use function file_exists ;
15
15
use function implode ;
16
+ use function libxml_clear_errors ;
16
17
use function libxml_get_errors ;
18
+ use function libxml_use_internal_errors ;
17
19
use function sprintf ;
18
20
use function trim ;
19
21
@@ -32,6 +34,9 @@ trait SchemaValidatableElementTrait
32
34
*/
33
35
public static function schemaValidate (DOMDocument $ document ): DOMDocument
34
36
{
37
+ $ internalErrors = libxml_use_internal_errors (true );
38
+ libxml_clear_errors ();
39
+
35
40
$ schemaFile = self ::getSchemaFile ();
36
41
// Must suppress the warnings here in order to throw them as an error below.
37
42
$ result = @$ document ->schemaValidate ($ schemaFile );
@@ -48,6 +53,9 @@ public static function schemaValidate(DOMDocument $document): DOMDocument
48
53
));
49
54
}
50
55
56
+ libxml_use_internal_errors ($ internalErrors );
57
+ libxml_clear_errors ();
58
+
51
59
return $ document ;
52
60
}
53
61
You can’t perform that action at this time.
0 commit comments