From e831c158c897a0ebc14d1b8dbd7c9c1ac51d7bb6 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 31 Mar 2008 22:44:38 +0000 Subject: [PATCH] Revert unintended bits from "Added a warning message" commit --- ext/standard/file.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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); -- 2.40.0