php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50767 XMLReader does not accept zip stream
Submitted: 2010-01-15 14:30 UTC Modified: 2010-01-25 10:43 UTC
From: jhgundersen at gmail dot com Assigned: rrichards (profile)
Status: Not a bug Package: Streams related
PHP Version: 5.3.1 OS: Ubuntu 9.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jhgundersen at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-15 14:30 UTC] jhgundersen at gmail dot com
Description:
------------
XMLReader has stopped working with zip streams. 

It easy to reproduce:

Make a zip file named test.zip with a single file named test.xml





Reproduce code:
---------------
echo file_get_contents('zip://test.zip#test.xml');

$reader = new XMLReader()
$reader->open('zip://test.zip#test.xml');

Expected result:
----------------
output of test.xml and no crash from xmlreader

Actual result:
--------------
output from test.xml is ok, but xmlreader crashes with:

XMLReader::open(): Unable to open source data

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-15 14:34 UTC] johannes@php.net
Are you sure you have the zip extension loaded?
 [2010-01-15 15:19 UTC] jhgundersen at gmail dot com
Zip stream works with file_get_contents, I can open the test.xml with zip archive
 [2010-01-18 17:32 UTC] pajoye@php.net
It works just fine here. It is rather expected as both file_get_contents and xmlreader use the exact same code to read a zip entry.

Please provide a link to the archive you use for this test or double check that you actually load the zip extension for this test.
 [2010-01-19 08:21 UTC] jhgundersen at gmail dot com
the zip extension is loaded:

Zip: enabled 
Extension Version: $Id: php_zip.c,v 1.1.2.38.2.29 2009/02/24 23:55:14 iliaa Exp $ 
Zip version: 	1.9.1 
Libzip version: 	0.9.0


I totally agree that it is weird that the zip protocol seems to be working everywhere else but with xmlreader.
 [2010-01-19 08:27 UTC] jhgundersen at gmail dot com
And it happens with every zip file I've tried.
 [2010-01-19 09:36 UTC] pajoye@php.net
Richard, can you take a look please? Maybe it will ring a bell? libxml stream bug or smtg else, but I can't reproduce it here, on unix (ubuntu 9.10) or win.
 [2010-01-19 12:05 UTC] rrichards@php.net
What version of libxml2 are you using?
 [2010-01-19 12:22 UTC] jhgundersen at gmail dot com
phpinfo gives me: 
libxml Version 	2.7.3
 [2010-01-21 10:07 UTC] jani@php.net
Rob, feedback was given.
 [2010-01-23 11:32 UTC] rrichards@php.net
Check all your error logs to see if anything unexpected happened. I also  
cannot reproduce this. Have tried it on 3 different OSs and it has 
worked properly on each
 [2010-01-25 10:38 UTC] jhgundersen at gmail dot com
I can't see anything of interests in the logs.

I'm using the Zend Server CE solution to install php on my ubuntu machines and then it seems to be something wrong in that package since I can reproduce the bug on all of my testmachines, but you guys cannot reproduce this bug at all.
 [2010-01-25 10:43 UTC] jani@php.net
Please ask support from Zend for Zend products.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 20:01:29 2024 UTC