]> granicus.if.org Git - php/commitdiff
Make scheme part decoding rfc2396 compliant.
authorWez Furlong <wez@php.net>
Fri, 19 Apr 2002 10:06:41 +0000 (10:06 +0000)
committerWez Furlong <wez@php.net>
Fri, 19 Apr 2002 10:06:41 +0000 (10:06 +0000)
Change zlib:// and bzip2:// to compress.zlib:// and compress.bzip2://
Tidy up old socket/network code/comments.

NEWS
ext/standard/fsock.c
ext/zlib/zlib.c
ext/zlib/zlib_fopen_wrapper.c
main/network.c
main/streams.c

diff --git a/NEWS b/NEWS
index 00d353ea0ba207f8b17de9aee2102f829e15ffd9..10d9e2352a6ff1db9f5db2a4ebe27ac64d17d230 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,9 +33,8 @@ PHP 4                                                                      NEWS
 - Added mysql_list_processes() and mysql_stat() functions. (Georg)
 - Added file_get_contents($filename), which returns the contents of a file
   as a string. It also supports URL wrappers. (Wez)
-- Changed fopen wrappers ('php://', 'bz2://' and 'zlib://') to require the
-  '://' separator (instead of simply 'php:', 'bz2:' and 'zlib:') to avoid
-  ambiguities when filenames have ':' characters. (Wez)
+- Changed 'zlib:' fopen wrapper to 'compress.zlib://' to avoid ambiguities
+  when filenames have ':' characters. (Wez)
 - Added URL-wrapper support to exif. (Marcus)
 - PHP now has a new stream system that allows it to do some clever stuff with
   fopen() and fsockopen().  As a result:
@@ -43,7 +42,7 @@ PHP 4                                                                      NEWS
   . fsockopen() adds support for ssl:// and tls:// connections via TCP/IP
   . copy($srcfilename, $destfilename) can now be used with URL wrappers
   . zlib wrappers/streams can be used even on systems without fopencookie()
-  . Added BZip2 stream support.
+  . Added 'compress.bzip2://' stream and wrapper support.
   . Added user-space streams - it is now possible to define a class in PHP
     code and register it as a URL wrapper.
   . Most extensions now support streams when passing files, which means
index 21eb6e8256e34e114fcafc84cf6ec4e1a2e66704..9d90788298352bbf17de6f1a6e8195f5bdadc800 100644 (file)
@@ -84,8 +84,6 @@
 
 #ifdef ZTS
 static int fsock_globals_id;
-#else
-extern int le_fp;
 #endif
 
 #ifdef PHP_WIN32
index fb63e7d12300f6945b91c499270e5424ef20a960..fbfd5820e322dfff2b3e7d9f4fc9aca5520ca888 100644 (file)
@@ -181,7 +181,7 @@ PHP_MINIT_FUNCTION(zlib)
 #ifdef ZTS
        ts_allocate_id(&zlib_globals_id, sizeof(zend_zlib_globals), (ts_allocate_ctor) php_zlib_init_globals, NULL);
 #endif
-       php_register_url_stream_wrapper("zlib", &php_stream_gzip_wrapper TSRMLS_CC);
+       php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC);
 
        REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | CONST_PERSISTENT);
index 0886689634e847feee3187bf556e6a1da1082f0a..034311b809e5885c5317852863036d867638985f 100644 (file)
@@ -101,8 +101,8 @@ php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mod
        
        self = emalloc(sizeof(*self));
 
-       if (strncasecmp("zlib://", path, 7) == 0)
-               path += 7;
+       if (strncasecmp("compress.zlib://", path, 16) == 0)
+               path += 16;
        else if (strncasecmp("zlib:", path, 5) == 0)
                path += 5;
        
index 03270bcdfad2d9d735b9a9a007d4549b5c1873eb..a34244e84ecf785f501f3444ecbceb8d00caf619 100644 (file)
@@ -465,7 +465,7 @@ PHPAPI php_stream *_php_stream_sock_open_unix(const char *path, int pathlen, int
        memset(&unix_addr, 0, sizeof(unix_addr));
        unix_addr.sun_family = AF_UNIX;
 
-       /* we need to be binary safe for the on systems that support an abstract
+       /* we need to be binary safe on systems that support an abstract
         * namespace */
        if (pathlen >= sizeof(unix_addr.sun_path)) {
                /* On linux, when the path begins with a NUL byte we are
index a6cfccddb84d3be845eab29675d9056e93a5935c..3af18e25b9b15ecd9c2d0eee75004845e7e98df9 100755 (executable)
@@ -1180,7 +1180,7 @@ static php_stream_wrapper *locate_url_wrapper(char *path, char **path_for_open,
        if (options & IGNORE_URL)
                return &php_plain_files_wrapper;
        
-       for (p = path; isalnum((int)*p); p++) {
+       for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) {
                n++;
        }
 
@@ -1188,9 +1188,9 @@ static php_stream_wrapper *locate_url_wrapper(char *path, char **path_for_open,
                protocol = path;
        } else if (strncasecmp(path, "zlib:", 5) == 0) {
                /* BC with older php scripts and zlib wrapper */
-               protocol = path;
-               n = 4;
-               zend_error(E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"zlib://\" instead.");
+               protocol = "compress.zlib";
+               n = 13;
+               zend_error(E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead.");
        }
 
        if (protocol)   {