cataphract Thu, 18 Nov 2010 12:10:17 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=305495
Log: - Implemented alternative strategy for change in rev #304985 so as to not to break binary compatibility in the 5.3 branch. Bug: http://bugs.php.net/304985 (error getting bug information) Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/file.c U php/php-src/branches/PHP_5_3/ext/standard/file.h U php/php-src/branches/PHP_5_3/ext/standard/ftp_fopen_wrapper.c U php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c Modified: php/php-src/branches/PHP_5_3/ext/standard/file.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/file.c 2010-11-18 11:33:42 UTC (rev 305494) +++ php/php-src/branches/PHP_5_3/ext/standard/file.c 2010-11-18 12:10:17 UTC (rev 305495) @@ -170,7 +170,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("user_agent", NULL, PHP_INI_ALL, OnUpdateString, user_agent, php_file_globals, file_globals) - STD_PHP_INI_ENTRY("from", NULL, PHP_INI_ALL, OnUpdateString, from_address, php_file_globals, file_globals) + PHP_INI_ENTRY("from", NULL, PHP_INI_ALL, NULL) STD_PHP_INI_ENTRY("default_socket_timeout", "60", PHP_INI_ALL, OnUpdateLong, default_socket_timeout, php_file_globals, file_globals) STD_PHP_INI_ENTRY("auto_detect_line_endings", "0", PHP_INI_ALL, OnUpdateLong, auto_detect_line_endings, php_file_globals, file_globals) PHP_INI_END() Modified: php/php-src/branches/PHP_5_3/ext/standard/file.h =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/file.h 2010-11-18 11:33:42 UTC (rev 305494) +++ php/php-src/branches/PHP_5_3/ext/standard/file.h 2010-11-18 12:10:17 UTC (rev 305495) @@ -119,7 +119,6 @@ long auto_detect_line_endings; long default_socket_timeout; char *user_agent; /* for the http wrapper */ - char *from_address; /* for the ftp and http wrappers */ char *user_stream_current_filename; /* for simple recursion protection */ php_stream_context *default_context; HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */ Modified: php/php-src/branches/PHP_5_3/ext/standard/ftp_fopen_wrapper.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/ftp_fopen_wrapper.c 2010-11-18 11:33:42 UTC (rev 305494) +++ php/php-src/branches/PHP_5_3/ext/standard/ftp_fopen_wrapper.c 2010-11-18 12:10:17 UTC (rev 305495) @@ -249,8 +249,9 @@ } else { /* if the user has configured who they are, send that as the password */ - if (FG(from_address)) { - php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", FG(from_address)); + char *from_address = php_ini_string("from", sizeof("from"), 0); + if (from_address[0] != '\0') { + php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", from_address); } else { php_stream_write_string(stream, "PASS anonymous\r\n"); } Modified: php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c 2010-11-18 11:33:42 UTC (rev 305494) +++ php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c 2010-11-18 12:10:17 UTC (rev 305495) @@ -443,9 +443,12 @@ } /* if the user has configured who they are, send a From: line */ - if (((have_header & HTTP_HEADER_FROM) == 0) && FG(from_address)) { - if (snprintf(scratch, scratch_len, "From: %s\r\n", FG(from_address)) > 0) - php_stream_write(stream, scratch, strlen(scratch)); + { + char *from_address = php_ini_string("from", sizeof("from"), 0); + if (((have_header & HTTP_HEADER_FROM) == 0) && from_address[0] != '\0') { + if (snprintf(scratch, scratch_len, "From: %s\r\n", from_address) > 0) + php_stream_write(stream, scratch, strlen(scratch)); + } } /* Send Host: header so name-based virtual hosts work */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php