From: Ilia Alshanetsky Date: Mon, 31 Mar 2008 22:44:38 +0000 (+0000) Subject: Revert unintended bits from "Added a warning message" commit X-Git-Tag: RELEASE_2_0_0b1~525 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e831c158c897a0ebc14d1b8dbd7c9c1ac51d7bb6;p=php Revert unintended bits from "Added a warning message" commit --- diff --git a/ext/standard/file.c b/ext/standard/file.c index b45ca3d9c3..9e23b9257d 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -622,8 +622,8 @@ PHP_FUNCTION(file_put_contents) long flags = ((argc < 3) && UG(unicode)) ? PHP_FILE_TEXT : 0; zval *zcontext = NULL; php_stream_context *context = NULL; + char mode[3] = { 'w', 0, 0 }; php_stream *srcstream = NULL; - char mode[3] = "wb"; if (zend_parse_parameters(argc TSRMLS_CC, "Zz/|lr!", &ppfilename, &data, &flags, &zcontext) == FAILURE) { return; @@ -659,10 +659,6 @@ PHP_FUNCTION(file_put_contents) RETURN_FALSE; } - if (mode[0] = 'c') { - php_stream_truncate_set_size(stream, 0); - } - switch (Z_TYPE_P(data)) { case IS_RESOURCE: numchars = php_stream_copy_to_stream(srcstream, stream, PHP_STREAM_COPY_ALL);