iliaa Sun Sep 3 16:32:27 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src NEWS
/php-src/main/streams streams.c
Log:
Fixed bug #38661 (mixed-case URL breaks url-wrappers).
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.231&r2=1.2027.2.547.2.232&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.231 php-src/NEWS:1.2027.2.547.2.232
--- php-src/NEWS:1.2027.2.547.2.231 Sun Sep 3 15:49:49 2006
+++ php-src/NEWS Sun Sep 3 16:32:27 2006
@@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Sep 2006, PHP 5.2.0RC4
+- Fixed bug #38661 (mixed-case URL breaks url-wrappers). (Ilia)
+
31 Aug 2006, PHP 5.2.0RC3
- Updated PCRE to version 6.7. (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.4&r2=1.82.2.6.2.5&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.4
php-src/main/streams/streams.c:1.82.2.6.2.5
--- php-src/main/streams/streams.c:1.82.2.6.2.4 Thu Jul 13 12:00:17 2006
+++ php-src/main/streams/streams.c Sun Sep 3 16:32:27 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.82.2.6.2.4 2006/07/13 12:00:17 tony2001 Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.5 2006/09/03 16:32:27 iliaa Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -1526,18 +1526,24 @@
}
if (protocol) {
- if (FAILURE == zend_hash_find(wrapper_hash, (char*)protocol, n,
(void**)&wrapperpp)) {
- char wrapper_name[32];
-
- if (n >= sizeof(wrapper_name))
- n = sizeof(wrapper_name) - 1;
- PHP_STRLCPY(wrapper_name, protocol,
sizeof(wrapper_name), n);
+ if (FAILURE == zend_hash_find(wrapper_hash, (char*)protocol, n,
(void**)&wrapperpp)) {
+ char *tmp = estrndup(protocol, n);
+ php_strtolower(tmp, n);
+ if (FAILURE == zend_hash_find(wrapper_hash, (char*)tmp,
n, (void**)&wrapperpp)) {
+ char wrapper_name[32];
+
+ efree(tmp);
+ if (n >= sizeof(wrapper_name)) {
+ n = sizeof(wrapper_name) - 1;
+ }
+ PHP_STRLCPY(wrapper_name, protocol,
sizeof(wrapper_name), n);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unable to
find the wrapper \"%s\" - did you forget to enable it when you configured PHP?",
- wrapper_name);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE,
"Unable to find the wrapper \"%s\" - did you forget to enable it when you
configured PHP?", wrapper_name);
- wrapperpp = NULL;
- protocol = NULL;
+ wrapperpp = NULL;
+ protocol = NULL;
+ }
+ efree(tmp);
}
}
/* TODO: curl based streams probably support file:// properly */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php