php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54440 libxml extension ignores default context
Submitted: 2011-04-01 11:43 UTC Modified: 2011-04-09 20:32 UTC
From: jpauli@php.net Assigned: cataphract (profile)
Status: Closed Package: Streams related
PHP Version: 5.3.6 OS: *nix
Private report: No CVE-ID: None
 [2011-04-01 11:43 UTC] jpauli@php.net
Description:
------------
stream_context_set_default() doesn't publish the context to all PHP extension.

Example is ext/libxml that doesn't recognize the context.

Test script:
---------------
stream_context_set_default(array('http'=>array('proxy'=>'my_proxy_url')));

$x = simplexml_load_file('http://some_resource');

Expected result:
----------------
The resource gets loaded through the HTTP proxy

Actual result:
--------------
The resource is not loaded through the HTTP proxy.
For this to work, we have to use :

$ctx = stream_context_create(array('http'=>array('proxy'=>'my_proxy_url')));
libxml_set_streams_context($ctx); // userland manual bind

$x = simplexml_load_file('http://some_resource');

Patches

libxslt_54440.patch (last revision 2011-04-03 22:32 UTC by cataphract@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-01 11:45 UTC] jpauli@php.net
See also #52926
 [2011-04-04 00:32 UTC] cataphract@php.net
The following patch has been added/updated:

Patch Name: libxslt_54440.patch
Revision:   1301869965
URL:        http://bugs.php.net/patch-display.php?bug=54440&patch=libxslt_54440.patch&revision=1301869965
 [2011-04-04 00:36 UTC] cataphract@php.net
Obviously the patch wasn't meant to be attached here. Sorry.
 [2011-04-09 20:32 UTC] cataphract@php.net
-Summary: stream_context_set_default() should publish the default context to everybody +Summary: libxml extension ignores default context -Status: Open +Status: Closed -Assigned To: +Assigned To: cataphract
 [2011-04-09 20:32 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=310109
Log: - Fixed bug #54440: libxml extension ignores default context.
 [2012-03-29 13:48 UTC] shein@php.net
Reproduced segfault on all 3 branches (debug build on amd64): 
/home/conf/php5.3/Zend/zend_hash.c(979) : ht=0x2de6a50 is already destroyed

Please also look at: http://ci.qa.php.net/job/php-src-trunk-matrix-
build/architecture=x86,os=linux-debian-6.0/lastCompletedBuild/testReport/php-
src.ext.libxml/tests/004_phpt___libxml_set_streams_context__/

and 

http://ci.qa.php.net/job/php-src-trunk-matrix-
build/architecture=x86,os=linux-debian-6.0/lastCompletedBuild/testReport/php-
src.ext.libxml/tests/bug54440_phpt___Bug__54440__libxml_extension_ignores_defaul
t
_context/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC