File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -711,23 +711,8 @@ XML_GetCurrentColumnNumber(XML_Parser parser)
711711PHP_XML_API int
712712XML_GetCurrentByteIndex (XML_Parser parser )
713713{
714- /* We have to temporarily disable the encoder to satisfy the note from the manual:
715- * "This function returns byte index according to UTF-8 encoded text disregarding if input is in another encoding."
716- * Although that should probably be corrected at one point? (TODO) */
717- xmlCharEncodingHandlerPtr encoder = NULL ;
718- xmlParserInputPtr input = parser -> parser -> input ;
719- ZEND_DIAGNOSTIC_IGNORED_START ("-Wdeprecated-declarations" )
720- if (input -> buf ) {
721- encoder = input -> buf -> encoder ;
722- input -> buf -> encoder = NULL ;
723- }
724- long result = xmlByteConsumed (parser -> parser );
725- if (encoder ) {
726- input -> buf -> encoder = encoder ;
727- }
728- ZEND_DIAGNOSTIC_IGNORED_END
729- /* TODO: at one point this should return long probably to make sure that files greater than 2 GiB are handled correctly. */
730- return (int ) result ;
714+ return parser -> parser -> input -> consumed +
715+ (parser -> parser -> input -> cur - parser -> parser -> input -> base );
731716}
732717
733718PHP_XML_API int
You can’t perform that action at this time.
0 commit comments