From:             
Operating system: Linux/Ubuntu
PHP version:      5.3.6
Package:          Streams related
Bug Type:         Bug
Bug description:HTTP context option "ignore_errors" does not work as expected

Description:
------------
>From documentation I would assume that making a HTTP request with 

"ignore_errors" context option I should always get response body no matter
the 

HTTP response code server sent back. This seems to work for just some of
the 

response codes (like 404) and will fail with others - "400 Bad Request" for


example.



This affects fopen() and file_get_contents() as far as I have tested.



An ideal solution would be to:



- if fopen() is called with HTTP context and "ignore_errors" - return a
valid 

resource (currently it will return false with a E_WARNING). Next calling 

stream_get_contents() on this resource should return response body. If 

"ignore_errors" is not set - behave the old way - keeping backwards-

compatibility.



- if file_get_contents() is called with HTTP context and "ignore_errors" -


return response body no matter HTTP response code. Otherwise - keep old 

functionality for backwards compatibility.



Because of this bug writing an API client with HTTP streams is somewhat of 


challenge (or not possible at all).


-- 
Edit bug report at http://bugs.php.net/bug.php?id=54898&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54898&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54898&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54898&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54898&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54898&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54898&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54898&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54898&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54898&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54898&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54898&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54898&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54898&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54898&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54898&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54898&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54898&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54898&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54898&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54898&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54898&r=mysqlcfg

Reply via email to