File tree Expand file tree Collapse file tree 3 files changed +51
-2
lines changed Expand file tree Collapse file tree 3 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
- XMLReader:
10
10
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
11
+ . Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
11
12
12
13
13
14
?? ??? 2013, PHP 5.4.21
Original file line number Diff line number Diff line change @@ -805,7 +805,6 @@ PHP_METHOD(xmlreader, read)
805
805
if (intern != NULL && intern -> ptr != NULL ) {
806
806
retval = xmlTextReaderRead (intern -> ptr );
807
807
if (retval == -1 ) {
808
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "An Error Occurred while reading" );
809
808
RETURN_FALSE ;
810
809
} else {
811
810
RETURN_BOOL (retval );
@@ -847,7 +846,6 @@ PHP_METHOD(xmlreader, next)
847
846
retval = xmlTextReaderNext (intern -> ptr );
848
847
}
849
848
if (retval == -1 ) {
850
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "An Error Occurred while reading" );
851
849
RETURN_FALSE ;
852
850
} else {
853
851
RETURN_BOOL (retval );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #64230 (XMLReader does not suppress errors)
3
+ --SKIPIF--
4
+ <?php
5
+ extension_loaded ("xmlreader " ) or die ("skip requires xmlreader " );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ echo "Test \n" ;
10
+
11
+ function show_internal_errors () {
12
+ foreach (libxml_get_errors () as $ error ) {
13
+ printf ("Internal: %s \n" , $ error ->message );
14
+ }
15
+ libxml_clear_errors ();
16
+ }
17
+
18
+ echo "Internal errors TRUE \n" ;
19
+ libxml_use_internal_errors (true );
20
+
21
+ $ x = new XMLReader ;
22
+ $ x ->xml ("<root att/> " );
23
+ $ x ->read ();
24
+
25
+ show_internal_errors ();
26
+
27
+ echo "Internal errors FALSE \n" ;
28
+ libxml_use_internal_errors (false );
29
+
30
+ $ x = new XMLReader ;
31
+ $ x ->xml ("<root att/> " );
32
+ $ x ->read ();
33
+
34
+ show_internal_errors ();
35
+
36
+ ?>
37
+ Done
38
+ --EXPECTF--
39
+ Test
40
+ Internal errors TRUE
41
+ Internal: Specification mandate value for attribute att
42
+
43
+ Internal errors FALSE
44
+
45
+ Warning: XMLReader::read(): %s: parser error : Specification mandate value for attribute att in %s on line %d
46
+
47
+ Warning: XMLReader::read(): <root att/> in %s on line %d
48
+
49
+ Warning: XMLReader::read(): ^ in %s on line %d
50
+ Done
You can’t perform that action at this time.
0 commit comments