File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ PHP NEWS
46
46
47
47
- XML:
48
48
. Fixed bug #30875 (xml_parse_into_struct() does not resolve entities). (cmb)
49
+ . Add support for getting SKIP_TAGSTART and SKIP_WHITE options. (cmb)
49
50
50
51
11 Oct 2018, PHP 7.2.11
51
52
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ xml_parser_get_option() with XML_OPTION_SKIP_TAGSTART and XML_OPTION_SKIP_WHITE
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('xml ' )) die ('skip xml extension not available ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ parser = xml_parser_create ();
10
+ echo "defaults: \n" ;
11
+ var_dump (xml_parser_get_option ($ parser , XML_OPTION_SKIP_TAGSTART ));
12
+ var_dump (xml_parser_get_option ($ parser , XML_OPTION_SKIP_WHITE ));
13
+ echo "setting: \n" ;
14
+ var_dump (xml_parser_set_option ($ parser , XML_OPTION_SKIP_TAGSTART , 7 ));
15
+ var_dump (xml_parser_set_option ($ parser , XML_OPTION_SKIP_WHITE , 1 ));
16
+ echo "getting: \n" ;
17
+ var_dump (xml_parser_get_option ($ parser , XML_OPTION_SKIP_TAGSTART ));
18
+ var_dump (xml_parser_get_option ($ parser , XML_OPTION_SKIP_WHITE ));
19
+ ?>
20
+ --EXPECT--
21
+ defaults:
22
+ int(0)
23
+ int(0)
24
+ setting:
25
+ bool(true)
26
+ bool(true)
27
+ getting:
28
+ int(7)
29
+ int(1)
Original file line number Diff line number Diff line change @@ -1643,6 +1643,12 @@ PHP_FUNCTION(xml_parser_get_option)
1643
1643
case PHP_XML_OPTION_CASE_FOLDING :
1644
1644
RETURN_LONG (parser -> case_folding );
1645
1645
break ;
1646
+ case PHP_XML_OPTION_SKIP_TAGSTART :
1647
+ RETURN_LONG (parser -> toffset );
1648
+ break ;
1649
+ case PHP_XML_OPTION_SKIP_WHITE :
1650
+ RETURN_LONG (parser -> skipwhite );
1651
+ break ;
1646
1652
case PHP_XML_OPTION_TARGET_ENCODING :
1647
1653
RETURN_STRING ((char * )parser -> target_encoding );
1648
1654
break ;
You can’t perform that action at this time.
0 commit comments