--- embedaddon/php/ext/standard/ftp_fopen_wrapper.c 2012/02/21 23:48:02 1.1 +++ embedaddon/php/ext/standard/ftp_fopen_wrapper.c 2013/07/22 01:32:05 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ | Sara Golemon | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c,v 1.1 2012/02/21 23:48:02 misho Exp $ */ +/* $Id: ftp_fopen_wrapper.c,v 1.1.1.3 2013/07/22 01:32:05 misho Exp $ */ #include "php.h" #include "php_globals.h" @@ -269,9 +269,8 @@ static php_stream *php_ftp_fopen_connect(php_stream_wr } else { /* if the user has configured who they are, send that as the password */ - 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); + if (FG(from_address)) { + php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", FG(from_address)); } else { php_stream_write_string(stream, "PASS anonymous\r\n"); } @@ -441,7 +440,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrappe if (strchr(mode, 'a')) { read_write = 3; /* Open for Appending */ } else { - read_write = 2; /* Open for writting */ + read_write = 2; /* Open for writing */ } } if (!read_write) { @@ -501,7 +500,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrappe } if (result <= 299 && result >= 200) { if (allow_overwrite) { - /* Context permits overwritting file, + /* Context permits overwriting file, so we just delete whatever's there in preparation */ php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); result = GET_FTP_RESULT(stream);