[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/TSRM/ tsrm_virtual_cwd.c
pajoye Fri, 09 Oct 2009 14:05:13 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289414 Log: - Merge Fix for #48746, improve fix for junctions/symlink/etc. Bug: http://bugs.php.net/48746 (Assigned) Unable to browse directories within Junction Points Changed paths: U php/php-src/branches/PHP_5_3_1/TSRM/tsrm_virtual_cwd.c Modified: php/php-src/branches/PHP_5_3_1/TSRM/tsrm_virtual_cwd.c === --- php/php-src/branches/PHP_5_3_1/TSRM/tsrm_virtual_cwd.c 2009-10-09 12:38:10 UTC (rev 289413) +++ php/php-src/branches/PHP_5_3_1/TSRM/tsrm_virtual_cwd.c 2009-10-09 14:05:13 UTC (rev 289414) @@ -667,11 +667,14 @@ /* File is a reparse point. Get the target */ HANDLE hLink = NULL; REPARSE_DATA_BUFFER * pbuffer; - unsigned int retlength = 0, rname_off = 0; - int bufindex = 0, rname_len = 0, isabsolute = 0; + unsigned int retlength = 0; + int bufindex = 0, isabsolute = 0; wchar_t * reparsetarget; - WCHAR szVolumePathNames[MAX_PATH]; BOOL isVolume = FALSE; + char printname[MAX_PATH]; + char substitutename[MAX_PATH]; + int printname_len, substitutename_len; + int substitutename_off = 0; if(++(*ll) LINK_MAX) { return -1; @@ -692,33 +695,61 @@ CloseHandle(hLink); if(pbuffer-ReparseTag == IO_REPARSE_TAG_SYMLINK) { - rname_len = pbuffer-SymbolicLinkReparseBuffer.PrintNameLength/2; - rname_off = pbuffer-SymbolicLinkReparseBuffer.PrintNameOffset/2; - if(rname_len = 0) { - rname_len = pbuffer-SymbolicLinkReparseBuffer.SubstituteNameLength/2; - rname_off = pbuffer-SymbolicLinkReparseBuffer.SubstituteNameOffset/2; - } - reparsetarget = pbuffer-SymbolicLinkReparseBuffer.ReparseTarget; + printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); isabsolute = (pbuffer-SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0; + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer-MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR), + printname_len + 1, + printname, MAX_PATH, NULL, NULL + )) { + tsrm_free_alloca(pbuffer, use_heap_large); + return -1; + }; + printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + printname[printname_len] = 0; + + substitutename_len = pbuffer-MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer-MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), + substitutename_len + 1, + substitutename, MAX_PATH, NULL, NULL + )) { + tsrm_free_alloca(pbuffer, use_heap_large); + return -1; + }; + substitutename[substitutename_len] = 0; } else if(pbuffer-ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { - rname_len = pbuffer-MountPointReparseBuffer.PrintNameLength/2; - rname_off = pbuffer-MountPointReparseBuffer.PrintNameOffset/2; - if(rname_len = 0) { - rname_len = pbuffer-MountPointReparseBuffer.SubstituteNameLength/2; - rname_off = pbuffer-MountPointReparseBuffer.SubstituteNameOffset/2; - } + isabsolute = 1; + reparsetarget = pbuffer-MountPointReparseBuffer.ReparseTarget; + printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/TSRM/ tsrm_win32.c
pajoye Fri, 09 Oct 2009 14:06:35 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289415 Log: - Merge revision 288028, use of the user token by default, and fix for touch and directory on windows Changed paths: U php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c Modified: php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c === --- php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c2009-10-09 14:05:13 UTC (rev 289414) +++ php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c2009-10-09 14:06:35 UTC (rev 289415) @@ -200,7 +200,7 @@ /* Keep the result in realpath_cache */ if(bucket != NULL) { - if(desired_access == FILE_GENERIC_READ) { + if(desired_access == (FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS)) { bucket-is_rvalid = 1; bucket-is_readable = fAccess; } @@ -318,7 +318,7 @@ char *ptype = (char *)type; HANDLE thread_token = NULL; HANDLE token_user = NULL; - BOOL asuser = FALSE; + BOOL asuser = TRUE; TSRMLS_FETCH(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ ext/ftp/ftp.c ext/openssl/xp_ssl.c ext/sockets/sockets.c main/network.c main/streams/xp_socket.c
pajoye Fri, 09 Oct 2009 14:20:17 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289416 Log: - Merge: Fixed bug #49447 php engine need to correctly check for socket API Bug: http://bugs.php.net/49447 (Closed) php engine need to correctly check for socket API return status on windows Changed paths: U php/php-src/branches/PHP_5_3_1/ext/ftp/ftp.c U php/php-src/branches/PHP_5_3_1/ext/openssl/xp_ssl.c U php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c U php/php-src/branches/PHP_5_3_1/main/network.c U php/php-src/branches/PHP_5_3_1/main/streams/xp_socket.c Modified: php/php-src/branches/PHP_5_3_1/ext/ftp/ftp.c === --- php/php-src/branches/PHP_5_3_1/ext/ftp/ftp.c2009-10-09 14:06:35 UTC (rev 289415) +++ php/php-src/branches/PHP_5_3_1/ext/ftp/ftp.c2009-10-09 14:20:17 UTC (rev 289416) @@ -147,7 +147,7 @@ size = sizeof(ftp-localaddr); memset(ftp-localaddr, 0, size); - if (getsockname(ftp-fd, (struct sockaddr*) ftp-localaddr, size) == -1) { + if (getsockname(ftp-fd, (struct sockaddr*) ftp-localaddr, size) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, getsockname failed: %s (%d), strerror(errno), errno); goto bail; } Modified: php/php-src/branches/PHP_5_3_1/ext/openssl/xp_ssl.c === --- php/php-src/branches/PHP_5_3_1/ext/openssl/xp_ssl.c 2009-10-09 14:06:35 UTC (rev 289415) +++ php/php-src/branches/PHP_5_3_1/ext/openssl/xp_ssl.c 2009-10-09 14:20:17 UTC (rev 289416) @@ -259,6 +259,10 @@ SSL_CTX_free(sslsock-ctx); sslsock-ctx = NULL; } +#ifdef PHP_WIN32 + if (sslsock-s.socket == -1) + sslsock-s.socket = SOCK_ERR; +#endif if (sslsock-s.socket != SOCK_ERR) { #ifdef PHP_WIN32 /* prevent more data from coming in */ Modified: php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c === --- php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c2009-10-09 14:06:35 UTC (rev 289415) +++ php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c2009-10-09 14:20:17 UTC (rev 289416) @@ -370,14 +370,14 @@ sock-type = PF_INET; - if (bind(sock-bsd_socket, (struct sockaddr *)la, sizeof(la)) 0) { + if (bind(sock-bsd_socket, (struct sockaddr *)la, sizeof(la)) != 0) { PHP_SOCKET_ERROR(sock, unable to bind to given address, errno); close(sock-bsd_socket); efree(sock); return 0; } - if (listen(sock-bsd_socket, backlog) 0) { + if (listen(sock-bsd_socket, backlog) != 0) { PHP_SOCKET_ERROR(sock, unable to listen on socket, errno); close(sock-bsd_socket); efree(sock); Modified: php/php-src/branches/PHP_5_3_1/main/network.c === --- php/php-src/branches/PHP_5_3_1/main/network.c 2009-10-09 14:06:35 UTC (rev 289415) +++ php/php-src/branches/PHP_5_3_1/main/network.c 2009-10-09 14:20:17 UTC (rev 289416) @@ -314,7 +314,7 @@ SET_SOCKET_BLOCKING_MODE(sockfd, orig_flags); - if ((n = connect(sockfd, addr, addrlen)) 0) { + if ((n = connect(sockfd, addr, addrlen)) != 0) { error = php_socket_errno(); if (error_code) { @@ -348,7 +348,7 @@ BSD-derived systems set errno correctly Solaris returns -1 from getsockopt in case of error */ - if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char*)error, len) 0) { + if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char*)error, len) != 0) { ret = -1; } } else { @@ -375,7 +375,7 @@ if (asynchronous) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Asynchronous connect() not supported on this platform); } - return connect(sockfd, addr, addrlen); + return (connect(sockfd, addr, addrlen) == 0) ? 0 : -1; #endif } /* }}} */ @@ -715,7 +715,7 @@ clisock = accept(srvsock, (struct sockaddr*)sa, sl); - if (clisock = 0) { + if (clisock != SOCK_ERR) { php_network_populate_name_from_sockaddr((struct sockaddr*)sa, sl, textaddr, textaddrlen, addr, addrlen @@ -867,7 +867,7 @@ timeout ? working_timeout : NULL, error_string, error_code); - if (n != SOCK_CONN_ERR) { + if (n != -1) {
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/sockets/ php_sockets.h sockets.c
pajoye Fri, 09 Oct 2009 14:22:29 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289417 Log: - merge: #49464, fix build Bug: http://bugs.php.net/49464 (Closed) php_sockets build broken Changed paths: U php/php-src/branches/PHP_5_3_1/ext/sockets/php_sockets.h U php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c Modified: php/php-src/branches/PHP_5_3_1/ext/sockets/php_sockets.h === --- php/php-src/branches/PHP_5_3_1/ext/sockets/php_sockets.h2009-10-09 14:20:17 UTC (rev 289416) +++ php/php-src/branches/PHP_5_3_1/ext/sockets/php_sockets.h2009-10-09 14:22:29 UTC (rev 289417) @@ -73,7 +73,9 @@ #ifndef PHP_WIN32 typedef int PHP_SOCKET; +# define PHP_SOCKETS_API PHPAPI #else +# define PHP_SOCKETS_API __declspec(dllexport) typedef SOCKET PHP_SOCKET; #endif @@ -91,7 +93,7 @@ }; #endif -PHPAPI int php_sockets_le_socket(void); +PHP_SOCKETS_API int php_sockets_le_socket(void); /* Prototypes */ #ifdef ilia_0 /* not needed, only causes a compiler warning */ Modified: php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c === --- php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c2009-10-09 14:20:17 UTC (rev 289416) +++ php/php-src/branches/PHP_5_3_1/ext/sockets/sockets.c2009-10-09 14:22:29 UTC (rev 289417) @@ -323,7 +323,7 @@ /* inet_ntop should be used instead of inet_ntoa */ int inet_ntoa_lock = 0; -PHPAPI int php_sockets_le_socket(void) /* {{{ */ +PHP_SOCKETS_API int php_sockets_le_socket(void) /* {{{ */ { return le_socket; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/pcre/ php_pcre.c
pajoye Fri, 09 Oct 2009 14:25:51 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289418 Log: - Merge: Fixed bug #49483 (preg_replace 'subject' parameter listed as optional) Bug: http://bugs.php.net/49483 (Closed) preg_replace 'subject' parameter listed as optional Changed paths: U php/php-src/branches/PHP_5_3_1/ext/pcre/php_pcre.c Modified: php/php-src/branches/PHP_5_3_1/ext/pcre/php_pcre.c === --- php/php-src/branches/PHP_5_3_1/ext/pcre/php_pcre.c 2009-10-09 14:22:29 UTC (rev 289417) +++ php/php-src/branches/PHP_5_3_1/ext/pcre/php_pcre.c 2009-10-09 14:25:51 UTC (rev 289418) @@ -1836,7 +1836,7 @@ ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_preg_replace, 0, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_preg_replace, 0, 0, 3) ZEND_ARG_INFO(0, regex) ZEND_ARG_INFO(0, replace) ZEND_ARG_INFO(0, subject) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/standard/ strnatcmp.c
pajoye Fri, 09 Oct 2009 14:33:38 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289419 Log: - Merge: Fix for bug #49698 Bug: http://bugs.php.net/49698 (Closed) Unexpected change in strnatcasecmp() Changed paths: U php/php-src/branches/PHP_5_3_1/ext/standard/strnatcmp.c Modified: php/php-src/branches/PHP_5_3_1/ext/standard/strnatcmp.c === --- php/php-src/branches/PHP_5_3_1/ext/standard/strnatcmp.c 2009-10-09 14:25:51 UTC (rev 289418) +++ php/php-src/branches/PHP_5_3_1/ext/standard/strnatcmp.c 2009-10-09 14:33:38 UTC (rev 289419) @@ -116,12 +116,12 @@ while (1) { ca = *ap; cb = *bp; - /* skip over leading zeros unless they are followed by punctuation */ - while (leading ca == '0' (ap+1 aend) !ispunct(*(ap+1))) { + /* skip over leading zeros */ + while (leading ca == '0' (ap+1 aend) isdigit(*(ap+1))) { ca = *++ap; } - while (leading cb == '0' (bp+1 bend) !ispunct(*(bp+1))) { + while (leading cb == '0' (bp+1 bend) isdigit(*(bp+1))) { cb = *++bp; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/standard/ credits.c
pajoye Fri, 09 Oct 2009 14:34:18 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289420 Log: - Merge: throw some credit around Changed paths: U php/php-src/branches/PHP_5_3_1/ext/standard/credits.c Modified: php/php-src/branches/PHP_5_3_1/ext/standard/credits.c === --- php/php-src/branches/PHP_5_3_1/ext/standard/credits.c 2009-10-09 14:33:38 UTC (rev 289419) +++ php/php-src/branches/PHP_5_3_1/ext/standard/credits.c 2009-10-09 14:34:18 UTC (rev 289420) @@ -109,10 +109,17 @@ } if (flag PHP_CREDITS_WEB) { - /* Website Team */ + /* Websites and infrastructure */ + php_info_print_table_start(); - php_info_print_table_header(1, PHP Website Team); - php_info_print_table_row(1, Rasmus Lerdorf, Hannes Magnusson, Philip Olson); + php_info_print_table_colspan_header(2, Websites and Infrastructure team); + /* www., wiki., windows., master., and others, I guess pecl. too? */ + CREDIT_LINE(PHP Websites Team, Rasmus Lerdorf, Hannes Magnusson, Philip Olson, Lukas Kahwe Smith, Pierre-Alain Joye, Kalle Sommer Nielsen); + CREDIT_LINE(Event Maintainers, Damien Seguy, Daniel P. Brown); + /* Mirroring */ + CREDIT_LINE(Network Infrastructure, Daniel P. Brown); + /* Windows build boxes and such things */ + CREDIT_LINE(Windows Infrastructure, Alex Schoenmaker); php_info_print_table_end(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/standard/ file.c
pajoye Fri, 09 Oct 2009 14:37:45 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289422 Log: - Merge: Make tempnam() return FALSE on error as documented Changed paths: U php/php-src/branches/PHP_5_3_1/ext/standard/file.c Modified: php/php-src/branches/PHP_5_3_1/ext/standard/file.c === --- php/php-src/branches/PHP_5_3_1/ext/standard/file.c 2009-10-09 14:37:09 UTC (rev 289421) +++ php/php-src/branches/PHP_5_3_1/ext/standard/file.c 2009-10-09 14:37:45 UTC (rev 289422) @@ -858,6 +858,8 @@ if (p_len 64) { p[63] = '\0'; } + + RETVAL_FALSE; if ((fd = php_open_temporary_fd(dir, p, opened_path TSRMLS_CC)) = 0) { close(fd); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/TSRM/ tsrm_win32.c
Shouldnt you keep track of mergeinfo? This mail was sent from my HTC MAGIC. Sorry for any and all typos that may have been in this mail. On Oct 9, 2009 4:06 p.m., Pierre-Alain Joye paj...@php.net wrote: pajoye Fri, 09 Oct 2009 14:06:35 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289415 Log: - Merge revision 288028, use of the user token by default, and fix for touch and directory on windows Changed paths: U php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c Modified: php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c === --- php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c2009-10-09 14:05:13 UTC (rev 289414) +++ php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c2009-10-09 14:06:35 UTC (rev 289415) @@ -200,7 +200,7 @@ /* Keep the result in realpath_cache */ if(bucket != NULL) { - if(desired_access == FILE_GENERIC_READ) { + if(desired_access == (FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS)) { bucket-is_rvalid = 1; bucket-is_readable = fAccess; } @@ -318,7 +318,7 @@ char *ptype = (char *)type; HANDLE thread_token = NULL; HANDLE token_user = NULL; - BOOL asuser = FALSE; + BOOL asuser = TRUE; TSRMLS_FETCH(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/TSRM/ tsrm_win32.c
if svn merge is used, yes, I don't use it for these commits. I tried but it fails for the 1st three patches, then I gave up. Cheers, On Fri, Oct 9, 2009 at 4:38 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: Shouldnt you keep track of mergeinfo? This mail was sent from my HTC MAGIC. Sorry for any and all typos that may have been in this mail. On Oct 9, 2009 4:06 p.m., Pierre-Alain Joye paj...@php.net wrote: pajoye Fri, 09 Oct 2009 14:06:35 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289415 Log: - Merge revision 288028, use of the user token by default, and fix for touch and directory on windows Changed paths: U php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c Modified: php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c === --- php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c 2009-10-09 14:05:13 UTC (rev 289414) +++ php/php-src/branches/PHP_5_3_1/TSRM/tsrm_win32.c 2009-10-09 14:06:35 UTC (rev 289415) @@ -200,7 +200,7 @@ /* Keep the result in realpath_cache */ if(bucket != NULL) { - if(desired_access == FILE_GENERIC_READ) { + if(desired_access == (FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS)) { bucket-is_rvalid = 1; bucket-is_readable = fAccess; } @@ -318,7 +318,7 @@ char *ptype = (char *)type; HANDLE thread_token = NULL; HANDLE token_user = NULL; - BOOL asuser = FALSE; + BOOL asuser = TRUE; TSRMLS_FETCH(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/oci8/ oci8.c tests/pecl_bug16842.phpt
pajoye Fri, 09 Oct 2009 14:44:43 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289423 Log: - Merge: Pecl #16842 Bug: http://pecl.php.net/bugs/16842 (unknown) Changed paths: U php/php-src/branches/PHP_5_3_1/ext/oci8/oci8.c A php/php-src/branches/PHP_5_3_1/ext/oci8/tests/pecl_bug16842.phpt Modified: php/php-src/branches/PHP_5_3_1/ext/oci8/oci8.c === --- php/php-src/branches/PHP_5_3_1/ext/oci8/oci8.c 2009-10-09 14:37:45 UTC (rev 289422) +++ php/php-src/branches/PHP_5_3_1/ext/oci8/oci8.c 2009-10-09 14:44:43 UTC (rev 289423) @@ -1529,6 +1529,12 @@ break; case OCI_NO_DATA: php_error_docref(NULL TSRMLS_CC, E_WARNING, OCI_NO_DATA); + errcode = php_oci_fetch_errmsg(err_p, errbuf TSRMLS_CC); + if (errbuf) { + efree(errbuf); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, OCI_NO_DATA: failed to fetch error message); + } break; case OCI_ERROR: errcode = php_oci_fetch_errmsg(err_p, errbuf TSRMLS_CC); Added: php/php-src/branches/PHP_5_3_1/ext/oci8/tests/pecl_bug16842.phpt === --- php/php-src/branches/PHP_5_3_1/ext/oci8/tests/pecl_bug16842.phpt (rev 0) +++ php/php-src/branches/PHP_5_3_1/ext/oci8/tests/pecl_bug16842.phpt 2009-10-09 14:44:43 UTC (rev 289423) @@ -0,0 +1,69 @@ +--TEST-- +PECL Bug #16842 (NO_DATA_FOUND exception is a warning) +--SKIPIF-- +?php if (!extension_loaded('oci8')) die (skip no oci8 extension); ? +--INI-- +error_reporting = E_WARNING +--FILE-- +?php + +require(dirname(__FILE__).'/connect.inc'); + +// Run Test + +echo Test 1\n; + +echo Raises NO_DATA_FOUND\n; +$s = oci_parse($c, 'begin raise NO_DATA_FOUND; end;'); +$e = oci_execute($s); +var_dump($e); +var_dump(oci_error($s)); + +echo Test 2\n; + +echo Raises ZERO_DIVIDE\n; +$s = oci_parse($c, 'begin raise ZERO_DIVIDE; end;'); +$e = oci_execute($s); +var_dump($e); +var_dump(oci_error($s)); + +oci_close($c); + +? +===DONE=== +?php exit(0); ? +--EXPECTF-- +Test 1 +Raises NO_DATA_FOUND + +Warning: oci_execute(): OCI_NO_DATA in %s on line 11 +bool(false) +array(4) { + [%u|b%code]= + int(1403) + [%u|b%message]= + %unicode|string%(45) ORA-01403: %s +ORA-06512: at line 1 + [%u|b%offset]= + int(0) + [%u|b%sqltext]= + %unicode|string%(31) begin raise NO_DATA_FOUND; end; +} +Test 2 +Raises ZERO_DIVIDE + +Warning: oci_execute(): ORA-01476: %s +ORA-06512: at line 1 in %s on line 19 +bool(false) +array(4) { + [%u|b%code]= + int(1476) + [%u|b%message]= + %unicode|string%(56) ORA-01476: %s +ORA-06512: at line 1 + [%u|b%offset]= + int(0) + [%u|b%sqltext]= + %unicode|string%(29) begin raise ZERO_DIVIDE; end; +} +===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/posix/ posix.c
pajoye Fri, 09 Oct 2009 14:46:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289424 Log: - Merge: Add missing open_basedir check in posix_mkfifo Changed paths: U php/php-src/branches/PHP_5_3_1/ext/posix/posix.c Modified: php/php-src/branches/PHP_5_3_1/ext/posix/posix.c === --- php/php-src/branches/PHP_5_3_1/ext/posix/posix.c2009-10-09 14:44:43 UTC (rev 289423) +++ php/php-src/branches/PHP_5_3_1/ext/posix/posix.c2009-10-09 14:46:48 UTC (rev 289424) @@ -840,7 +840,8 @@ RETURN_FALSE; } - if (PG(safe_mode) (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR))) { + if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) || + (PG(safe_mode) (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR { RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/TSRM/ tsrm_win32.c
Then what is the plan? Manually merging every. Commit one at a time and keep track in a hidden wiki page? This mail was sent from my HTC MAGIC. Sorry for any and all typos that may have been in this mail. On Oct 9, 2009 4:41 p.m., Pierre Joye pierre@gmail.com wrote: if svn merge is used, yes, I don't use it for these commits. I tried but it fails for the 1st three patches, then I gave up. Cheers, On Fri, Oct 9, 2009 at 4:38 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: Shouldnt you... -- Pierre http://blog.thepimp.net | http://www.libgd.org
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/fileinfo/libmagic/ readcdf.c
pajoye Fri, 09 Oct 2009 14:51:25 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289425 Log: - Merge: Fix #49732, Crashes in fileinfo when corrupted files are given (timestamp fails) Bug: http://bugs.php.net/49732 (Closed) PHP crashes when using finfo_file() to get mime info with this file (included) Changed paths: U php/php-src/branches/PHP_5_3_1/ext/fileinfo/libmagic/readcdf.c Modified: php/php-src/branches/PHP_5_3_1/ext/fileinfo/libmagic/readcdf.c === --- php/php-src/branches/PHP_5_3_1/ext/fileinfo/libmagic/readcdf.c 2009-10-09 14:46:48 UTC (rev 289424) +++ php/php-src/branches/PHP_5_3_1/ext/fileinfo/libmagic/readcdf.c 2009-10-09 14:51:25 UTC (rev 289425) @@ -125,7 +125,10 @@ return -1; } else { char *c, *ec; - cdf_timestamp_to_timespec(ts, tp); + + if (cdf_timestamp_to_timespec(ts, tp) == -1) { + return -1; + } c = ctime(ts.tv_sec); if ((ec = strchr(c, '\n')) != NULL) *ec = '\0'; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/TSRM/ tsrm_win32.c
the plan is to get the job done. On Fri, Oct 9, 2009 at 4:46 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: Then what is the plan? Manually merging every. Commit one at a time and keep track in a hidden wiki page? This mail was sent from my HTC MAGIC. Sorry for any and all typos that may have been in this mail. On Oct 9, 2009 4:41 p.m., Pierre Joye pierre@gmail.com wrote: if svn merge is used, yes, I don't use it for these commits. I tried but it fails for the 1st three patches, then I gave up. Cheers, On Fri, Oct 9, 2009 at 4:38 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: Shouldnt you... -- Pierre http://blog.thepimp.net | http://www.libgd.org -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/standard/ file.c
pajoye Fri, 09 Oct 2009 14:37:09 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289421 Log: - Merge: Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak Changed paths: U php/php-src/branches/PHP_5_3_1/ext/standard/file.c Modified: php/php-src/branches/PHP_5_3_1/ext/standard/file.c === --- php/php-src/branches/PHP_5_3_1/ext/standard/file.c 2009-10-09 14:34:18 UTC (rev 289420) +++ php/php-src/branches/PHP_5_3_1/ext/standard/file.c 2009-10-09 14:37:09 UTC (rev 289421) @@ -846,6 +846,10 @@ return; } + if (PG(safe_mode) (!php_checkuid(dir, NULL, CHECKUID_ALLOW_ONLY_DIR))) { + RETURN_FALSE; + } + if (php_check_open_basedir(dir TSRMLS_CC)) { RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ main/fopen_wrappers.c sapi/cgi/cgi_main.c
pajoye Fri, 09 Oct 2009 17:03:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289428 Log: - Merge: Fixed bug #49182 (PHP CGI always outputs the shebang line), kill unused var Bug: http://bugs.php.net/49182 (Closed) PHP CGI always outputs the shebang line Changed paths: U php/php-src/branches/PHP_5_3_1/main/fopen_wrappers.c U php/php-src/branches/PHP_5_3_1/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3_1/main/fopen_wrappers.c === --- php/php-src/branches/PHP_5_3_1/main/fopen_wrappers.c2009-10-09 15:32:08 UTC (rev 289427) +++ php/php-src/branches/PHP_5_3_1/main/fopen_wrappers.c2009-10-09 17:03:56 UTC (rev 289428) @@ -382,9 +382,12 @@ */ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) { + FILE *fp; +#ifndef PHP_WIN32 + struct stat st; +#endif char *path_info, *filename; int length; - zend_bool orig_display_errors; filename = SG(request_info).path_translated; path_info = SG(request_info).request_uri; @@ -451,7 +454,7 @@ } } /* if doc_root path_info */ - if(filename) { + if (filename) { filename = zend_resolve_path(filename, strlen(filename) TSRMLS_CC); } @@ -463,21 +466,33 @@ STR_FREE(SG(request_info).path_translated); SG(request_info).path_translated = NULL; return FAILURE; - } else { - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = filename; } + fp = VCWD_FOPEN(filename, rb); - orig_display_errors = PG(display_errors); - PG(display_errors) = 0; - if (zend_stream_open(filename, file_handle TSRMLS_CC) == FAILURE) { - PG(display_errors) = orig_display_errors; +#ifndef PHP_WIN32 + /* refuse to open anything that is not a regular file */ + if (fp (0 fstat(fileno(fp), st) || !S_ISREG(st.st_mode))) { + fclose(fp); + fp = NULL; + } +#endif + + if (!fp) { STR_FREE(SG(request_info).path_translated); /* for same reason as above */ SG(request_info).path_translated = NULL; return FAILURE; } - PG(display_errors) = orig_display_errors; + file_handle-opened_path = expand_filepath(filename, NULL TSRMLS_CC); + + STR_FREE(SG(request_info).path_translated); /* for same reason as above */ + SG(request_info).path_translated = filename; + + file_handle-filename = SG(request_info).path_translated; + file_handle-free_filename = 0; + file_handle-handle.fp = fp; + file_handle-type = ZEND_HANDLE_FP; + return SUCCESS; } /* }}} */ Modified: php/php-src/branches/PHP_5_3_1/sapi/cgi/cgi_main.c === --- php/php-src/branches/PHP_5_3_1/sapi/cgi/cgi_main.c 2009-10-09 15:32:08 UTC (rev 289427) +++ php/php-src/branches/PHP_5_3_1/sapi/cgi/cgi_main.c 2009-10-09 17:03:56 UTC (rev 289428) @@ -159,6 +159,7 @@ typedef struct _php_cgi_globals_struct { zend_bool rfc2616_headers; zend_bool nph; + zend_bool check_shebang_line; zend_bool fix_pathinfo; zend_bool force_redirect; zend_bool discard_path; @@ -1279,9 +1280,6 @@ if (pt) { efree(pt); } - if (is_valid_path(script_path_translated)) { - SG(request_info).path_translated = estrdup(script_path_translated); - } } else { /* make sure path_info/translated are empty */ if (!orig_script_filename || @@ -1310,9 +1308,6 @@ } else { SG(request_info).request_uri = env_script_name; } - if (is_valid_path(script_path_translated)) { - SG(request_info).path_translated = estrdup(script_path_translated); - } free(real_path); } } else { @@ -1325,11 +1320,12 @@ if (!CGIG(discard_path) env_path_translated) { script_path_translated = env_path_translated; } - if (is_valid_path(script_path_translated)) { - SG(request_info).path_translated = estrdup(script_path_translated); - } } + if (is_valid_path(script_path_translated)) {
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt trunk/ext/standard/tests/strings/bug49785.phpt
moriyoshiFri, 09 Oct 2009 17:13:05 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289429 Log: - More tests to go. Changed paths: U php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt U php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt U php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt 2009-10-09 17:03:56 UTC (rev 289428) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt 2009-10-09 17:13:05 UTC (rev 289429) @@ -6,6 +6,22 @@ return is_string($val) ? bin2hex($val): $val; } +// UTF-8: basic tests +var_dump(bin2hex(htmlentities(\xc1\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xc2\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xce\x91, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xce\xb1, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xdf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xe0\xa0\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xe0\x9f\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xe2\x99\xa5, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xef\xbf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf0\x8f\xbf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf0\x90\x80\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf7\xbf\xbf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf8\x88\x80\x80\x80, ENT_QUOTES, UTF-8))); + +echo --\n; // UTF-8: alternative (invalid) UTF-8 sequence var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8'))); var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8'))); @@ -98,8 +114,22 @@ ? --EXPECT-- string(0) +string(4) c280 +string(14) 26416c7068613b +string(14) 26616c7068613b +string(4) dfbf +string(6) e0a080 string(0) +string(16) 266865617274733b +string(6) efbfbf string(0) +string(8) f0908080 +string(8) f7bfbfbf +string(0) +-- +string(0) +string(0) +string(0) string(2) 80 string(2) a0 string(2) a1 Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt 2009-10-09 17:03:56 UTC (rev 289428) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt 2009-10-09 17:13:05 UTC (rev 289429) @@ -6,6 +6,22 @@ return is_string($val) ? bin2hex($val): $val; } +// UTF-8: basic tests +var_dump(bin2hex(htmlentities(\xc1\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xc2\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xce\x91, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xce\xb1, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xdf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xe0\xa0\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xe0\x9f\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xe2\x99\xa5, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xef\xbf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf0\x8f\xbf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf0\x90\x80\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf7\xbf\xbf\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xf8\x88\x80\x80\x80, ENT_QUOTES, UTF-8))); + +echo --\n; // UTF-8: alternative (invalid) UTF-8 sequence var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8'))); var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8'))); @@ -98,8 +114,22 @@ ? --EXPECT-- string(0) +string(4) c280 +string(14) 26416c7068613b +string(14) 26616c7068613b +string(4) dfbf +string(6) e0a080 string(0) +string(16) 266865617274733b +string(6) efbfbf string(0) +string(8) f0908080 +string(8) f7bfbfbf +string(0) +-- +string(0) +string(0) +string(0) string(2) 80 string(2) a0 string(2) a1 Modified: php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt === --- php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt 2009-10-09 17:03:56 UTC (rev 289428) +++ php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt 2009-10-09 17:13:05 UTC (rev 289429) @@ -6,6 +6,22 @@ return is_string($val) ? bin2hex($val): $val; } +// UTF-8: basic tests +var_dump(bin2hex(htmlentities(\xc1\xbf, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xc2\x80, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xce\x91, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xce\xb1, ENT_QUOTES, UTF-8))); +var_dump(bin2hex(htmlentities(\xdf\xbf, ENT_QUOTES, UTF-8)));
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/standard/ info.c
pajoye Fri, 09 Oct 2009 17:15:46 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289430 Log: - Merge: fix #40013, php_uname() doesnt return nodename (MFH) Bug: http://bugs.php.net/40013 (Closed) php_uname() doesnt return nodename Changed paths: U php/php-src/branches/PHP_5_3_1/ext/standard/info.c Modified: php/php-src/branches/PHP_5_3_1/ext/standard/info.c === --- php/php-src/branches/PHP_5_3_1/ext/standard/info.c 2009-10-09 17:13:05 UTC (rev 289429) +++ php/php-src/branches/PHP_5_3_1/ext/standard/info.c 2009-10-09 17:15:46 UTC (rev 289430) @@ -527,9 +527,33 @@ if (uname((struct utsname *)buf) == -1) { php_uname = PHP_UNAME; } else { +#ifdef NETWARE if (mode == 's') { php_uname = buf.sysname; } else if (mode == 'r') { + snprintf(tmp_uname, sizeof(tmp_uname), %d.%d.%d, +buf.netware_major, buf.netware_minor, buf.netware_revision); + php_uname = tmp_uname; + } else if (mode == 'n') { + php_uname = buf.servername; + } else if (mode == 'v') { + snprintf(tmp_uname, sizeof(tmp_uname), libc-%d.%d.%d #%d, +buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold); + php_uname = tmp_uname; + } else if (mode == 'm') { + php_uname = buf.machine; + } else { /* assume mode == 'a' */ + snprintf(tmp_uname, sizeof(tmp_uname), %s %s %d.%d.%d libc-%d.%d.%d #%d %s, +buf.sysname, buf.servername, +buf.netware_major, buf.netware_minor, buf.netware_revision, +buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold, +buf.machine); + php_uname = tmp_uname; + } +#else + if (mode == 's') { + php_uname = buf.sysname; + } else if (mode == 'r') { php_uname = buf.release; } else if (mode == 'n') { php_uname = buf.nodename; @@ -543,6 +567,7 @@ buf.machine); php_uname = tmp_uname; } +#endif /* NETWARE */ } #else php_uname = PHP_UNAME; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/Zend/ zend_API.c
pajoye Fri, 09 Oct 2009 17:21:20 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289431 Log: - Merge: don't hide early declaration Changed paths: U php/php-src/branches/PHP_5_3_1/Zend/zend_API.c Modified: php/php-src/branches/PHP_5_3_1/Zend/zend_API.c === --- php/php-src/branches/PHP_5_3_1/Zend/zend_API.c 2009-10-09 17:15:46 UTC (rev 289430) +++ php/php-src/branches/PHP_5_3_1/Zend/zend_API.c 2009-10-09 17:21:20 UTC (rev 289431) @@ -1038,13 +1038,13 @@ Z_SET_ISREF_PP(q); zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL); } else { - zval *q; + zval *r; - ALLOC_ZVAL(q); - *q = **p; - INIT_PZVAL(q); - zval_copy_ctor(q); - zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL); + ALLOC_ZVAL(r); + *r = **p; + INIT_PZVAL(r); + zval_copy_ctor(r); + zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)r, sizeof(zval*), NULL); } zend_hash_move_forward_ex(class_type-default_static_members, pos); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/Zend/ zend_compile.c
pajoye Fri, 09 Oct 2009 17:23:01 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289432 Log: - Merge: don't hide early declaration Changed paths: U php/php-src/branches/PHP_5_3_1/Zend/zend_compile.c Modified: php/php-src/branches/PHP_5_3_1/Zend/zend_compile.c === --- php/php-src/branches/PHP_5_3_1/Zend/zend_compile.c 2009-10-09 17:21:20 UTC (rev 289431) +++ php/php-src/branches/PHP_5_3_1/Zend/zend_compile.c 2009-10-09 17:23:01 UTC (rev 289432) @@ -5191,31 +5191,31 @@ if (CG(current_namespace)) { /* Prefix import name with current namespace name to avoid conflicts with classes */ - char *ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1); + char *c_ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1); - zend_str_tolower_copy(ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); - ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\'; - memcpy(ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, Z_STRLEN_P(name)+1); - if (zend_hash_exists(CG(class_table), ns_name, Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) { + zend_str_tolower_copy(c_ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); + c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\'; + memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, Z_STRLEN_P(name)+1); + if (zend_hash_exists(CG(class_table), c_ns_name, Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) { char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) || - memcmp(tmp, ns_name, Z_STRLEN_P(ns))) { + memcmp(tmp, c_ns_name, Z_STRLEN_P(ns))) { zend_error(E_COMPILE_ERROR, Cannot use %s as %s because the name is already in use, Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(tmp); } - efree(ns_name); + efree(c_ns_name); } else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, (void**)pce) == SUCCESS (*pce)-type == ZEND_USER_CLASS (*pce)-filename == CG(compiled_filename)) { - char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); + char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) || - memcmp(tmp, lcname, Z_STRLEN_P(ns))) { + memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) { zend_error(E_COMPILE_ERROR, Cannot use %s as %s because the name is already in use, Z_STRVAL_P(ns), Z_STRVAL_P(name)); } - efree(tmp); + efree(c_tmp); } if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, ns, sizeof(zval*), NULL) != SUCCESS) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/mcrypt/ mcrypt.c tests/bug49738.phpt
pajoye Fri, 09 Oct 2009 17:28:52 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289433 Log: - Merge: Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes) Bug: http://bugs.php.net/49738 (Closed) calling mcrypt after mcrypt_generic_deinit crashes Changed paths: U php/php-src/branches/PHP_5_3_1/ext/mcrypt/mcrypt.c A php/php-src/branches/PHP_5_3_1/ext/mcrypt/tests/bug49738.phpt Modified: php/php-src/branches/PHP_5_3_1/ext/mcrypt/mcrypt.c === --- php/php-src/branches/PHP_5_3_1/ext/mcrypt/mcrypt.c 2009-10-09 17:23:01 UTC (rev 289432) +++ php/php-src/branches/PHP_5_3_1/ext/mcrypt/mcrypt.c 2009-10-09 17:28:52 UTC (rev 289433) @@ -780,6 +780,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, Could not terminate encryption specifier); RETURN_FALSE } + pm-init = 0; RETURN_TRUE } /* }}} */ Added: php/php-src/branches/PHP_5_3_1/ext/mcrypt/tests/bug49738.phpt === --- php/php-src/branches/PHP_5_3_1/ext/mcrypt/tests/bug49738.phpt (rev 0) +++ php/php-src/branches/PHP_5_3_1/ext/mcrypt/tests/bug49738.phpt 2009-10-09 17:28:52 UTC (rev 289433) @@ -0,0 +1,13 @@ +--TEST-- +Bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes) +--SKIPIF-- +?php if (!extension_loaded(mcrypt)) print skip; ? +--FILE-- +?php + $td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, ''); + mcrypt_generic_init($td, '', ''); + mcrypt_generic_deinit($td); + echo mcrypt_generic($td, ''); +? +--EXPECTF-- +Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug49738.php on line 5 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/filter/ filter.c tests/bug49274.phpt
pajoye Fri, 09 Oct 2009 17:32:53 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289434 Log: - Merge: fix #49274, filter_var does not accept object without a toString implementation Bug: http://bugs.php.net/49274 (Assigned) filter_var() should accept objects without fatal error Changed paths: U php/php-src/branches/PHP_5_3_1/ext/filter/filter.c A php/php-src/branches/PHP_5_3_1/ext/filter/tests/bug49274.phpt Modified: php/php-src/branches/PHP_5_3_1/ext/filter/filter.c === --- php/php-src/branches/PHP_5_3_1/ext/filter/filter.c 2009-10-09 17:28:52 UTC (rev 289433) +++ php/php-src/branches/PHP_5_3_1/ext/filter/filter.c 2009-10-09 17:32:53 UTC (rev 289434) @@ -365,6 +365,19 @@ if (copy) { SEPARATE_ZVAL(value); } + + /* #49274, fatal error with object without a toString method + Fails nicely instead of getting a recovarable fatal error. */ + if (Z_TYPE_PP(value) == IS_OBJECT) { + zend_class_entry *ce; + + ce = Z_OBJCE_PP(value); + if (!ce-__tostring) { + ZVAL_FALSE(*value); + return; + } + } + /* Here be strings */ convert_to_string(*value); Added: php/php-src/branches/PHP_5_3_1/ext/filter/tests/bug49274.phpt === --- php/php-src/branches/PHP_5_3_1/ext/filter/tests/bug49274.phpt (rev 0) +++ php/php-src/branches/PHP_5_3_1/ext/filter/tests/bug49274.phpt 2009-10-09 17:32:53 UTC (rev 289434) @@ -0,0 +1,10 @@ +--TEST-- +#49274, fatal error when an object does not implement toString +--SKIPIF-- +?php if (!extension_loaded(filter)) die(skip); ? +--FILE-- +?php +var_dump(filter_var(new stdClass, FILTER_VALIDATE_EMAIL)); +? +--EXPECTF-- +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/imap/ php_imap.c
pajoye Fri, 09 Oct 2009 17:38:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289435 Log: - Merge: Fixed bug #49630 (imap_listscan function missing) Bug: http://bugs.php.net/49630 (Closed) imap_listscan function missing Changed paths: U php/php-src/branches/PHP_5_3_1/ext/imap/php_imap.c Modified: php/php-src/branches/PHP_5_3_1/ext/imap/php_imap.c === --- php/php-src/branches/PHP_5_3_1/ext/imap/php_imap.c 2009-10-09 17:32:53 UTC (rev 289434) +++ php/php-src/branches/PHP_5_3_1/ext/imap/php_imap.c 2009-10-09 17:38:19 UTC (rev 289435) @@ -487,6 +487,7 @@ PHP_FE(imap_delete, arginfo_imap_delete) PHP_FE(imap_undelete, arginfo_imap_undelete) PHP_FE(imap_check, arginfo_imap_check) + PHP_FE(imap_listscan, arginfo_imap_listscan) PHP_FE(imap_mail_copy, arginfo_imap_mail_copy) PHP_FE(imap_mail_move, arginfo_imap_mail_move) PHP_FE(imap_mail_compose, arginfo_imap_mail_compose) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/standard/ basic_functions.c
pajoye Fri, 09 Oct 2009 17:41:29 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289436 Log: - Merge: long2ip() can return wrong value in a multi-threaded applications Changed paths: U php/php-src/branches/PHP_5_3_1/ext/standard/basic_functions.c Modified: php/php-src/branches/PHP_5_3_1/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_3_1/ext/standard/basic_functions.c 2009-10-09 17:38:19 UTC (rev 289435) +++ php/php-src/branches/PHP_5_3_1/ext/standard/basic_functions.c 2009-10-09 17:41:29 UTC (rev 289436) @@ -3932,6 +3932,9 @@ int ip_len; unsigned long n; struct in_addr myaddr; +#ifdef HAVE_INET_PTON + char str[40]; +#endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, ip, ip_len) == FAILURE) { return; @@ -3940,7 +3943,15 @@ n = strtoul(ip, NULL, 0); myaddr.s_addr = htonl(n); +#ifdef HAVE_INET_PTON + if (inet_ntop(AF_INET, myaddr, str, sizeof(str))) { + RETURN_STRING(str, 1); + } else { + RETURN_FALSE; + } +#else RETURN_STRING(inet_ntoa(myaddr), 1); +#endif } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/main/streams/ memory.c
pajoye Fri, 09 Oct 2009 17:45:03 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289437 Log: - Merge: Fixed bug #49572 (use of C++ style comments causes build failure) Bug: http://bugs.php.net/49572 (Closed) use of C++ style comments causes build failure Changed paths: U php/php-src/branches/PHP_5_3_1/main/streams/memory.c Modified: php/php-src/branches/PHP_5_3_1/main/streams/memory.c === --- php/php-src/branches/PHP_5_3_1/main/streams/memory.c2009-10-09 17:41:29 UTC (rev 289436) +++ php/php-src/branches/PHP_5_3_1/main/streams/memory.c2009-10-09 17:45:03 UTC (rev 289437) @@ -563,7 +563,7 @@ stream = php_stream_alloc_rel(php_stream_temp_ops, self, 0, mode TEMP_STREAM_READONLY ? rb : w+b); stream-flags |= PHP_STREAM_FLAG_NO_BUFFER; self-innerstream = php_stream_memory_create_rel(mode); - php_stream_auto_cleanup(self-innerstream); // do not warn if innerstream is GC'ed before stream + php_stream_auto_cleanup(self-innerstream); /* do not warn if innerstream is GC'ed before stream */ ((php_stream_memory_data*)self-innerstream-abstract)-owner_ptr = self-innerstream; return stream; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/filter/ sanitizing_filters.c
pajoye Fri, 09 Oct 2009 17:50:17 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289438 Log: - Merge: Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters) Bug: http://bugs.php.net/49470 (Closed) FILTER_SANITIZE_EMAIL does not work Changed paths: U php/php-src/branches/PHP_5_3_1/ext/filter/sanitizing_filters.c Modified: php/php-src/branches/PHP_5_3_1/ext/filter/sanitizing_filters.c === --- php/php-src/branches/PHP_5_3_1/ext/filter/sanitizing_filters.c 2009-10-09 17:45:03 UTC (rev 289437) +++ php/php-src/branches/PHP_5_3_1/ext/filter/sanitizing_filters.c 2009-10-09 17:50:17 UTC (rev 289438) @@ -275,7 +275,7 @@ void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL) { /* Check section 6 of rfc 822 http://www.faqs.org/rfcs/rfc822.html */ - const unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT !#$%'*+-/=?^_`{|}...@.[]; + const unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT !#$%'*+-=?^_`{|}...@.[]; filter_map map; filter_map_init(map); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/dom/ documenttype.c
pajoye Fri, 09 Oct 2009 18:52:59 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289439 Log: - Merge: fix mem leak Changed paths: U php/php-src/branches/PHP_5_3_1/ext/dom/documenttype.c Modified: php/php-src/branches/PHP_5_3_1/ext/dom/documenttype.c === --- php/php-src/branches/PHP_5_3_1/ext/dom/documenttype.c 2009-10-09 17:50:17 UTC (rev 289438) +++ php/php-src/branches/PHP_5_3_1/ext/dom/documenttype.c 2009-10-09 18:52:59 UTC (rev 289439) @@ -190,7 +190,6 @@ xmlDtdPtr dtdptr; xmlDtd *intsubset; xmlOutputBuffer *buff = NULL; - xmlChar *strintsubset; dtdptr = (xmlDtdPtr) dom_object_get_node(obj); @@ -206,9 +205,8 @@ if (buff != NULL) { xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); xmlOutputBufferFlush(buff); - strintsubset = xmlStrndup(buff-buffer-content, buff-buffer-use); + ZVAL_STRINGL(*retval, buff-buffer-content, buff-buffer-use, 1); (void)xmlOutputBufferClose(buff); - ZVAL_STRING(*retval, (char *) strintsubset, 1); return SUCCESS; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/pdo_dblib/ dblib_driver.c
pajoye Fri, 09 Oct 2009 18:56:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289440 Log: - Possible fix for bug #49344 on Windows (pdo_mssql fails to connect,throws PDOException SQLSTATE[] (null) (severity 0)) Bug: http://bugs.php.net/49344 (No Feedback) pdo_mssql fails to connect,throws PDOException SQLSTATE[] (null) (severity 0) Changed paths: U php/php-src/branches/PHP_5_3_1/ext/pdo_dblib/dblib_driver.c Modified: php/php-src/branches/PHP_5_3_1/ext/pdo_dblib/dblib_driver.c === --- php/php-src/branches/PHP_5_3_1/ext/pdo_dblib/dblib_driver.c 2009-10-09 18:52:59 UTC (rev 289439) +++ php/php-src/branches/PHP_5_3_1/ext/pdo_dblib/dblib_driver.c 2009-10-09 18:56:19 UTC (rev 289440) @@ -230,11 +230,11 @@ goto cleanup; } -#if PHP_DBLIB_IS_MSSQL - if (DBSETOPT(H-link, DBTEXTLIMIT, 2147483647) == FAIL) { - goto cleanup; - } -#endif + /* dblib do not return more than this length from text/image */ + DBSETOPT(H-link, DBTEXTLIMIT, 2147483647); + + /* limit text/image from network */ + DBSETOPT(H-link, DBTEXTSIZE, 2147483647); if (vars[3].optval FAIL == dbuse(H-link, vars[3].optval)) { goto cleanup; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/date/ php_date.c
pajoye Fri, 09 Oct 2009 18:59:14 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289441 Log: - Merege: Fix bug #49558 And as Colin mentioned in the bug report, this means date_sunrise() and date_sunset() have been off by 26 seconds in most cases until now Bug: http://bugs.php.net/49558 (Closed) Sunrise Problems around 91 degree zenith Changed paths: U php/php-src/branches/PHP_5_3_1/ext/date/php_date.c Modified: php/php-src/branches/PHP_5_3_1/ext/date/php_date.c === --- php/php-src/branches/PHP_5_3_1/ext/date/php_date.c 2009-10-09 18:56:19 UTC (rev 289440) +++ php/php-src/branches/PHP_5_3_1/ext/date/php_date.c 2009-10-09 18:59:14 UTC (rev 289441) @@ -3927,7 +3927,7 @@ } timelib_unixtime2local(t, time); - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude -1 ? 1 : 0, h_rise, h_set, rise, set, transit); + rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, 1, h_rise, h_set, rise, set, transit); timelib_time_dtor(t); if (rs != 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ ext/date/php_date.c main/main.c main/php_globals.h
pajoye Fri, 09 Oct 2009 19:06:10 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289442 Log: - Merge: Fixed bug #49627 (error_log to specified file does not log time according to date.timezone) Bug: http://bugs.php.net/49627 (Closed) error_log to specified file does not log time according to date.timezone Changed paths: U php/php-src/branches/PHP_5_3_1/ext/date/php_date.c U php/php-src/branches/PHP_5_3_1/main/main.c U php/php-src/branches/PHP_5_3_1/main/php_globals.h Modified: php/php-src/branches/PHP_5_3_1/ext/date/php_date.c === --- php/php-src/branches/PHP_5_3_1/ext/date/php_date.c 2009-10-09 18:59:14 UTC (rev 289441) +++ php/php-src/branches/PHP_5_3_1/ext/date/php_date.c 2009-10-09 19:06:10 UTC (rev 289442) @@ -849,7 +849,17 @@ return env; } /* Check config setting for default timezone */ - if (DATEG(default_timezone) (strlen(DATEG(default_timezone)) 0) timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) { + if (!DATEG(default_timezone)) { + /* Special case: ext/date wasn't initialized yet */ + zval ztz; + + if (SUCCESS == zend_get_configuration_directive(date.timezone, sizeof(date.timezone), ztz) + Z_TYPE(ztz) == IS_STRING + Z_STRLEN(ztz) 0 + timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) { + return Z_STRVAL(ztz); + } + } else if (*DATEG(default_timezone) timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) { return DATEG(default_timezone); } #if HAVE_TM_ZONE Modified: php/php-src/branches/PHP_5_3_1/main/main.c === --- php/php-src/branches/PHP_5_3_1/main/main.c 2009-10-09 18:59:14 UTC (rev 289441) +++ php/php-src/branches/PHP_5_3_1/main/main.c 2009-10-09 19:06:10 UTC (rev 289442) @@ -556,11 +556,18 @@ int fd = -1; time_t error_time; + if (PG(in_error_log)) { + /* prevent recursive invocation */ + return; + } + PG(in_error_log) = 1; + /* Try to use the specified logging location. */ if (PG(error_log) != NULL) { #ifdef HAVE_SYSLOG_H if (!strcmp(PG(error_log), syslog)) { php_syslog(LOG_NOTICE, %.500s, log_message); + PG(in_error_log) = 0; return; } #endif @@ -571,7 +578,7 @@ char *error_time_str; time(error_time); - error_time_str = php_format_date(d-M-Y H:i:s, 11, error_time, php_during_module_startup() TSRMLS_CC); + error_time_str = php_format_date(d-M-Y H:i:s, 11, error_time, 1 TSRMLS_CC); len = spprintf(tmp, 0, [%s] %s%s, error_time_str, log_message, PHP_EOL); #ifdef PHP_WIN32 php_flock(fd, 2); @@ -580,6 +587,7 @@ efree(tmp); efree(error_time_str); close(fd); + PG(in_error_log) = 0; return; } } @@ -589,6 +597,7 @@ if (sapi_module.log_message) { sapi_module.log_message(log_message); } + PG(in_error_log) = 0; } /* }}} */ @@ -1352,6 +1361,7 @@ #endif zend_try { + PG(in_error_log) = 0; PG(during_request_startup) = 1; php_output_activate(TSRMLS_C); Modified: php/php-src/branches/PHP_5_3_1/main/php_globals.h === --- php/php-src/branches/PHP_5_3_1/main/php_globals.h 2009-10-09 18:59:14 UTC (rev 289441) +++ php/php-src/branches/PHP_5_3_1/main/php_globals.h 2009-10-09 19:06:10 UTC (rev 289442) @@ -168,6 +168,8 @@ zend_bool mail_x_header; char *mail_log; + + zend_bool in_error_log; }; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3_1/ext/openssl/ openssl.c
pajoye Fri, 09 Oct 2009 19:08:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289443 Log: - Merge: Fixed certificate validation inside php_openssl_apply_verification_policy Changed paths: U php/php-src/branches/PHP_5_3_1/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_3_1/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_3_1/ext/openssl/openssl.c2009-10-09 19:06:10 UTC (rev 289442) +++ php/php-src/branches/PHP_5_3_1/ext/openssl/openssl.c2009-10-09 19:08:56 UTC (rev 289443) @@ -4323,8 +4323,15 @@ GET_VER_OPT_STRING(CN_match, cnmatch); if (cnmatch) { int match = 0; + int name_len = X509_NAME_get_text_by_NID(name, NID_commonName, buf, sizeof(buf)); - X509_NAME_get_text_by_NID(name, NID_commonName, buf, sizeof(buf)); + if (name_len == -1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to locate peer certificate CN); + return FAILURE; + } else if (name_len != strlen(buf)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Peer certificate CN=`%.*s' is malformed, name_len, buf); + return FAILURE; + } match = strcmp(cnmatch, buf) == 0; if (!match strlen(buf) 3 buf[0] == '*' buf[1] == '.') { @@ -4339,10 +4346,7 @@ if (!match) { /* didn't match */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - Peer certificate CN=`%s' did not match expected CN=`%s', - buf, cnmatch); - + php_error_docref(NULL TSRMLS_CC, E_WARNING, Peer certificate CN=`%.*s' did not match expected CN=`%s', name_len, buf, cnmatch); return FAILURE; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
garretts Fri, 09 Oct 2009 19:43:00 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289445 Log: - changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case insensitive (garretts) Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/NEWS 2009-10-09 19:43:00 UTC (rev 289445) @@ -1,6 +1,8 @@ PHPNEWS ||| ?? ??? 20??, PHP 5.3.2 +- changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case + insensitive (garretts) - Added ReflectionMethod::setAccessible() for invoking non-public methods through the Reflection API. (Sebastian) Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:43:00 UTC (rev 289445) @@ -41,6 +41,20 @@ #define S_ISREG(mode) (((mode) S_IFMT) == S_IFREG) #endif +#ifdef PHP_WIN32 +#define TRANSLATE_SLASHES(path) \ + { \ + char *tmp = path; \ + while (*tmp) { \ + if (*tmp == '\\') *tmp = '/'; \ + tmp++; \ + } \ + } +#else +#define TRANSLATE_SLASHES(path) +#endif + + typedef struct _php_extension_lists { zend_llist engine; zend_llist functions; @@ -273,7 +287,13 @@ key_len = Z_STRLEN_P(arg1) - sizeof(PATH) + 1; is_special_section = 1; has_per_dir_config = 1; +#ifdef PHP_WIN32 + // make the path lowercase on Windows, for case insensitivty. + strlwr(key); + TRANSLATE_SLASHES(key); +#endif + /* HOST sections */ } else if (!strncasecmp(Z_STRVAL_P(arg1), HOST, sizeof(HOST) - 1)) { key = Z_STRVAL_P(arg1); @@ -281,6 +301,7 @@ key_len = Z_STRLEN_P(arg1) - sizeof(HOST) + 1; is_special_section = 1; has_per_host_config = 1; + strlwr(key); // host names are case-insensitive. } else { is_special_section = 0; Modified: php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c === --- php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-09 19:43:00 UTC (rev 289445) @@ -754,7 +754,11 @@ if it is inside the docroot, we scan the tree up to the docroot to find more user.ini, if not we only scan the current path. */ +#ifdef PHP_WIN32 + if (strnicmp(s1, s2, s_len) == 0) { +#else if (strncmp(s1, s2, s_len) == 0) { +#endif ptr = s2 + start; /* start is the point where doc_root ends! */ while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { *ptr = 0; @@ -777,7 +781,7 @@ static int sapi_cgi_activate(TSRMLS_D) { char *path, *doc_root, *server_name; - uint path_len, doc_root_len; + uint path_len, doc_root_len, server_name_len; /* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */ if (!SG(request_info).path_translated) { @@ -789,7 +793,11 @@ server_name = sapi_cgibin_getenv(SERVER_NAME, sizeof(SERVER_NAME) - 1 TSRMLS_CC); /* SERVER_NAME should also be defined at this stage..but better check it anyway */ if (server_name) { - php_ini_activate_per_host_config(server_name, strlen(server_name) + 1 TSRMLS_CC); + server_name_len = strlen(server_name); + server_name = estrndup(server_name, strlen(server_name) ); + strlwr(server_name); + php_ini_activate_per_host_config(server_name, server_name_len + 1 TSRMLS_CC); +
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
felipe Fri, 09 Oct 2009 20:01:16 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289446 Log: - Fixed build and comment-style Changed paths: U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 20:01:16 UTC (rev 289446) @@ -288,7 +288,7 @@ is_special_section = 1; has_per_dir_config = 1; #ifdef PHP_WIN32 - // make the path lowercase on Windows, for case insensitivty. + /* make the path lowercase on Windows, for case insensitivty. */ strlwr(key); TRANSLATE_SLASHES(key); @@ -301,7 +301,7 @@ key_len = Z_STRLEN_P(arg1) - sizeof(HOST) + 1; is_special_section = 1; has_per_host_config = 1; - strlwr(key); // host names are case-insensitive. + zend_str_tolower(key, key_len); /* host names are case-insensitive. */ } else { is_special_section = 0; Modified: php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c === --- php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-09 20:01:16 UTC (rev 289446) @@ -794,8 +794,8 @@ /* SERVER_NAME should also be defined at this stage..but better check it anyway */ if (server_name) { server_name_len = strlen(server_name); - server_name = estrndup(server_name, strlen(server_name) ); - strlwr(server_name); + server_name = estrndup(server_name, server_name_len); + zend_str_tolower(server_name, server_name_len); php_ini_activate_per_host_config(server_name, server_name_len + 1 TSRMLS_CC); efree(server_name); } @@ -819,7 +819,7 @@ } path[path_len] = 0; #ifdef PHP_WIN32 - // paths on windows should be case-insensitive + /* paths on windows should be case-insensitive */ strlwr(path); #endif @@ -836,7 +836,7 @@ --doc_root_len; } #ifdef PHP_WIN32 - // paths on windows should be case-insensitive + /* paths on windows should be case-insensitive */ doc_root = estrndup(doc_root, doc_root_len); strlwr(doc_root); #endif Modified: php/php-src/trunk/main/php_ini.c === --- php/php-src/trunk/main/php_ini.c2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/trunk/main/php_ini.c2009-10-09 20:01:16 UTC (rev 289446) @@ -288,7 +288,7 @@ is_special_section = 1; has_per_dir_config = 1; #ifdef PHP_WIN32 - // make the path lowercase on Windows, for case insensitivty. + /* make the path lowercase on Windows, for case insensitivty. */ strlwr(key); TRANSLATE_SLASHES(key); @@ -301,7 +301,7 @@ key_len = Z_STRLEN_P(arg1) - sizeof(HOST) + 1; is_special_section = 1; has_per_host_config = 1; - strlwr(key); // host names are case-insensitive. + zend_str_tolower(key, key_len); /* host names are case-insensitive. */ } else { is_special_section = 0; Modified: php/php-src/trunk/sapi/cgi/cgi_main.c === --- php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-09 20:01:16 UTC (rev 289446) @@ -791,8 +791,8 @@
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
On Fri, Oct 9, 2009 at 21:43, Garrett Serack garre...@php.net wrote: garretts Fri, 09 Oct 2009 19:43:00 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289445 Log: - changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case insensitive (garretts) Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/NEWS 2009-10-09 19:43:00 UTC (rev 289445) @@ -1,6 +1,8 @@ PHP NEWS ||| ?? ??? 20??, PHP 5.3.2 +- changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case + insensitive (garretts) - Added ReflectionMethod::setAccessible() for invoking non-public methods through the Reflection API. (Sebastian) Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:43:00 UTC (rev 289445) @@ -41,6 +41,20 @@ #define S_ISREG(mode) (((mode) S_IFMT) == S_IFREG) #endif +#ifdef PHP_WIN32 +#define TRANSLATE_SLASHES(path) \ + { \ + char *tmp = path; \ + while (*tmp) { \ + if (*tmp == '\\') *tmp = '/'; \ + tmp++; \ + } \ + } +#else +#define TRANSLATE_SLASHES(path) +#endif + + typedef struct _php_extension_lists { zend_llist engine; zend_llist functions; @@ -273,7 +287,13 @@ key_len = Z_STRLEN_P(arg1) - sizeof(PATH) + 1; is_special_section = 1; has_per_dir_config = 1; +#ifdef PHP_WIN32 + // make the path lowercase on Windows, for case insensitivty. + strlwr(key); Sorry for my ignorance, but would this work for IDN? -Hannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
hi Hannes, IDN are pure ascii as well (the encoded version), I don't think it is even possible to define a vhost using unicode. Cheers, On Fri, Oct 9, 2009 at 10:20 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: On Fri, Oct 9, 2009 at 21:43, Garrett Serack garre...@php.net wrote: garretts Fri, 09 Oct 2009 19:43:00 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289445 Log: - changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case insensitive (garretts) Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/NEWS 2009-10-09 19:43:00 UTC (rev 289445) @@ -1,6 +1,8 @@ PHP NEWS ||| ?? ??? 20??, PHP 5.3.2 +- changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case + insensitive (garretts) - Added ReflectionMethod::setAccessible() for invoking non-public methods through the Reflection API. (Sebastian) Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:13:33 UTC (rev 289444) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:43:00 UTC (rev 289445) @@ -41,6 +41,20 @@ #define S_ISREG(mode) (((mode) S_IFMT) == S_IFREG) #endif +#ifdef PHP_WIN32 +#define TRANSLATE_SLASHES(path) \ + { \ + char *tmp = path; \ + while (*tmp) { \ + if (*tmp == '\\') *tmp = '/'; \ + tmp++; \ + } \ + } +#else +#define TRANSLATE_SLASHES(path) +#endif + + typedef struct _php_extension_lists { zend_llist engine; zend_llist functions; @@ -273,7 +287,13 @@ key_len = Z_STRLEN_P(arg1) - sizeof(PATH) + 1; is_special_section = 1; has_per_dir_config = 1; +#ifdef PHP_WIN32 + // make the path lowercase on Windows, for case insensitivty. + strlwr(key); Sorry for my ignorance, but would this work for IDN? -Hannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php