php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72181 XML Reader - Parser error on valid XML
Submitted: 2016-05-09 16:11 UTC Modified: 2016-09-02 20:32 UTC
Votes:7
Avg. Score:4.7 ± 0.5
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:0 (0.0%)
From: alanhmlam at gmail dot com Assigned:
Status: No Feedback Package: XML Reader
PHP Version: 7.0.6 OS: Windows Server 2008
Private report: No CVE-ID: None
 [2016-05-09 16:11 UTC] alanhmlam at gmail dot com
Description:
------------
valid.xml: https://al2k4.s-ul.eu/BGiN0kKt

Reverting back to 7.0.2 will cause XML Reader to read the XML properly.
Version 7.0.3 or higher will cause XML Reader to throw "Input is not proper UTF-8".

Test script:
---------------
<?php
$reader = new XMLReader();
$reader->open("valid.xml");
while($reader->read()) {
}
?>

Expected result:
----------------
No output.

Actual result:
--------------
PHP Warning:  XMLReader::read(): file:/C:/Test/valid.xml:6: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xE2 0x80 0x93 0x20 in C:\Test\test.php on line 5

Warning: XMLReader::read(): file:/C:/Test/valid.xml:6: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xE2 0x80 0x93 0x20 in C:\Test\test.php on line 5
PHP Warning:  XMLReader::read(): f the train station. Open day to be held on Saturday 21st November between 10am  in C:\Test\test.php on line 5

Warning: XMLReader::read(): f the train station. Open day to be held on Saturday 21st November between 10am  in C:\Test\test.php on line 5
PHP Warning:  XMLReader::read():                                                                                ^ in C:\Test\test.php on line 5

Warning: XMLReader::read():                                                                                ^ in C:\Test\test.php on line 5

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-09 16:18 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-05-09 16:18 UTC] ab@php.net
Thanks for the report. It looks very similar to the bug #71805 which is caused by a libxml regression. This should be fixed in the 7.0.7RC1. Please check, it'll be out this week.

Thanks.
 [2016-05-22 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2016-09-02 15:25 UTC] webtota at gmail dot com
still reproducible on 7.0.8
 [2016-09-02 20:32 UTC] requinix@php.net
I cannot reproduce on 7.0.9.

@webtota: please check that the given XML and code works for you, then create a new report for your bug.
 [2017-01-17 12:48 UTC] ptrktck at gmail dot com
reproduced on 7.0.13-0ubuntu0.16.04.1
works properly on 7.0.12-1+deb.sury.org~trusty+1

not sure if different ppa's matter here
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC