Bug #36947 [Com]: HTTP stream wrapper does not treat all 2xx status codes as successful

2012-06-27 Thread poll...@php.net
Edit report at https://bugs.php.net/bug.php?id=36947&edit=1

 ID: 36947
 Comment by: poll...@php.net
 Reported by:Jared dot Williams1 at ntlworld dot com
 Summary:HTTP stream wrapper does not treat all 2xx status
 codes as successful
 Status: Open
 Type:   Bug
 Package:Streams related
 Operating System:   Win2000
 PHP Version:5.1.3RC2
 Block user comment: N
 Private report: N

 New Comment:

Could you elaborate on "not fixed" (preferably with a repro case)?  The code 
added by Mike in 2008 seems pretty liberal:


/* all status codes in the 2xx range are defined by the specification as 
successful;
 * all status codes in the 3xx range are for redirection, and so also should 
never
 * fail */
if (response_code >= 200 && response_code < 400) {
reqok = 1;


Previous Comments:

[2012-02-01 05:46:56] josh at joshbutts dot com

This does not appear to be fixed in 5.3.6 compiled from source on Mac OS 10.7


[2008-10-27 11:59:01] bj...@php.net

Fixed in PHP5.3, but I don't think it has been documented properly yet.
See: http://php.markmail.org/message/5rockhlt6hj7tzrb


[2006-04-02 13:39:17] Jared dot Williams1 at ntlworld dot com

Was raised on php internals ~year ago..

http://marc.theaimsgroup.com/?l=php-dev&m=111383344601864&w=2

http://marc.theaimsgroup.com/?l=php-dev&m=111384113712112&w=2

http://marc.theaimsgroup.com/?l=php-dev&m=111384249807034&w=2


[2006-04-02 13:20:04] Jared dot Williams1 at ntlworld dot com

Description:

PHP HTTP stream wrapper does not treat all http 2xx status codes as successful, 
making it impossible to use with WebDAV.








-- 
Edit this bug report at https://bugs.php.net/bug.php?id=36947&edit=1


Bug #61665 [Com]: include on stream wrapper results in wsod

2012-06-27 Thread poll...@php.net
Edit report at https://bugs.php.net/bug.php?id=61665&edit=1

 ID: 61665
 Comment by: poll...@php.net
 Reported by:btmash at gmail dot com
 Summary:include on stream wrapper results in wsod
 Status: Open
 Type:   Bug
 Package:Streams related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

Hi, could you paste the wrapper code again? That link is invalid (the content 
hosting site went down).  Thanks!


Previous Comments:

[2012-04-19 08:08:15] btmash at gmail dot com

I'm setting it back to open since I've provided feedback.


[2012-04-09 23:29:13] btmash at gmail dot com

I've pasted a version of the class at http://paste.pocoo.org/show/578721/ since 
it is longer than 20 lines.

Please note that a large chunk of this is the drupal stream wrapper interface 
and at the bottom is the stream class that I implemented 'MyLocalStreamWrapper' 
which returns back the directory it is currently in. I perform an include to a 
info.php file which consists of:
"
http://drupal.org/project/configuration) that provided its own contributed 
stream wrapper to find the local configuration directory (so it was in the 
format 'config://path/to/file' - the implementation can be seen at 
http://drupalcode.org/project/configuration.git/blob/refs/heads/7.x-1.x:/configuration_stream.inc).
 On my local environment of running the site with the module (which runs php 
5.3.6), the configuration would be able to scan on files with the protocol 
without any issues. 

However, once I moved to my staging environment which runs php 5.3.10, I would 
end up with a wsod. The strange part was that the page returned a code 200 and 
nothing in the error log. I made sure that allow_url_fopen was enabled and the 
protocols actually registered so it should have worked correctly. Moreover, 
using file_exists and is_file work to ensure the file exists so that meant the 
file was being found the first time around.

For now, my workaround has been to use drupal's functions to get the stream 
converted correctly (see http://drupal.org/files/config-stream.patch as my 
workaround for the module to work) but problem seems to stem from PHP which is 
why I am filing my issue here. Any help that can be provided would be greatly 
appreciated.

Test script:
---
Implement a simple stream wrapper to a file in local (lets call it local).

Create a php file to include from somewhere (called test_include.inc).

Have the line 'include local://path/to/test_include.inc'.

Expected result:

It should result in a code 200 but also a wsod.

Actual result:
--
The script should be correctly included.






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61665&edit=1