#36622 [Bgs->Opn]: fopen() wrappers accessible per se

From: Date: Sun, 26 Mar 2006 02:21:35 +0000
Subject: #36622 [Bgs->Opn]: fopen() wrappers accessible per se
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-94889@lists.php.net to get a copy of this message
ID: 36622 User updated by: php-bug at t43 dot mine dot nu Reported By: php-bug at t43 dot mine dot nu -Status: Bogus +Status: Open -Bug Type: Feature/Change Request +Bug Type: Filesystem function related Operating System: all PHP Version: 5.1.2 New Comment: file:// und php:// are documented as unrestricted by allow_url_fopen, see appendix M, tables M-1 and M-6. However there is a bug in Windows consisting in that file:// is restricted in Windows when allow_url_fopen=Off. http:// and ftp:// are available thru CURL in similar ways as thru fopen(), just there is no example for FTP in the PHP Manual, only for http:// . Previous Comments: ------------------------------------------------------------------------ [2006-03-26 03:43:11] php-bug at t43 dot mine dot nu I believe http:// and ftp:// can be done using CURL, gzip is also available directly. Just a question of documentation and helpful books (which aren't) thru the phpmaze. ------------------------------------------------------------------------ [2006-03-26 00:48:42] php-bug at t43 dot mine dot nu Delving into source code, main/streams/plain_wrapper.c ext/standard/basic_functions.c ext/standard/http_fopen_wrapper.c it becomes obvious that the predefined streams (file, http,..) are not made in php with stream_register_wrapper('protocol',php_class), and therefore there is no class of which a new instance could be simply created. http_fopen_wrapper.c teaches me that it would be not trivial to do http myself. ------------------------------------------------------------------------ [2006-03-05 23:42:52] php-bug at t43 dot mine dot nu Maybe I was not writing too clear. I would like to access the protocol wrappers one way or the other, but not only mangled into fopen(). It would love to say allow_url_fopen=Off, and still do ftp/http->stream_open (ftp/http://host.tld/myfile.txt) for example. I looked into Streams (chapter CXLV. Stream Functions), but there the wrappers, or the class names of the wrappers, or the objects, are not available for use. ------------------------------------------------------------------------ [2006-03-05 22:30:43] php-bug at t43 dot mine dot nu Description: ------------ The protocol:// wrappers are availabe only thru fopen() and similar calls, right now, which can be unsafe... It would be great if they where callable by themselfes, as not everyone will easily write the protocols. They can be useful despite allow_url_fopen . (In other words, allow_url_fopen=false will block fopen(), but does not hinder the knowing of doing it manually, however hinders the less knowing of securing fopen() easily AND using explicitely wrappers. I'm in this situation.) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36622&edit=1

« previous php.bugs (#94889) next »