]> granicus.if.org Git - php/commitdiff
Fix errormessage check
authorHannes Magnusson <bjori@php.net>
Tue, 31 Mar 2009 16:25:58 +0000 (16:25 +0000)
committerHannes Magnusson <bjori@php.net>
Tue, 31 Mar 2009 16:25:58 +0000 (16:25 +0000)
# Is correct in 5.

main/streams/userspace.c

index 67010ea861d7c55d78059ac90cbca69842e6c5ce..99cf7d4bda320894816822065e563f848b0e3f16 100644 (file)
@@ -515,7 +515,7 @@ PHP_FUNCTION(stream_wrapper_register)
                        RETURN_TRUE;
                } else {
                        /* We failed.  But why? */
-                       if (zend_hash_exists(php_stream_get_url_stream_wrappers_hash(), protocol, protocol_len)) {
+                       if (zend_hash_exists(php_stream_get_url_stream_wrappers_hash(), protocol, protocol_len+1)) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol %s:// is already defined", protocol);
                        } else {
                                /* Hash doesn't exist so it must have been an invalid protocol scheme */