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 @@ -28,6 +28,7 @@ PHP NEWS
28
28
29
29
- XML:
30
30
. Fixed bug #30875 (xml_parse_into_struct() does not resolve entities). (cmb)
31
+ . Add support for getting SKIP_TAGSTART and SKIP_WHITE options. (cmb)
31
32
32
33
11 Oct 2018, PHP 7.1.23
33
34
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 @@ -1653,6 +1653,12 @@ PHP_FUNCTION(xml_parser_get_option)
1653
1653
case PHP_XML_OPTION_CASE_FOLDING :
1654
1654
RETURN_LONG (parser -> case_folding );
1655
1655
break ;
1656
+ case PHP_XML_OPTION_SKIP_TAGSTART :
1657
+ RETURN_LONG (parser -> toffset );
1658
+ break ;
1659
+ case PHP_XML_OPTION_SKIP_WHITE :
1660
+ RETURN_LONG (parser -> skipwhite );
1661
+ break ;
1656
1662
case PHP_XML_OPTION_TARGET_ENCODING :
1657
1663
RETURN_STRING ((char * )parser -> target_encoding );
1658
1664
break ;
You can’t perform that action at this time.
0 commit comments