- Fixed bug with raw_post_data not getting set. (Brian)
- Fixed bug in mysql::client_version(). (Georg)
- Fixed ZTS destruction. (Marcus)
+- Fixed bug #32491 (File upload error - unable to create a temporary file).
+ (Uwe Schindler)
- Fixed bug #32109 ($_POST is not populated in multithreaded environment).
(Moriyoshi)
- Fixed bug #31478 (segfault with empty() / isset()). (Moriyoshi)
zend_bool magic_quotes_gpc;
multipart_buffer *mbuff;
zval *array_ptr = (zval *) arg;
- FILE *fp;
+ int fd=-1;
zend_llist header;
if (SG(request_info).content_length > SG(post_max_size)) {
if (!skip_upload) {
/* Handle file */
- fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC);
- if (!fp) {
+ fd = php_open_temporary_fd(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC);
+ if (fd==-1) {
sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary file");
cancel_upload = UPLOAD_ERROR_E;
}
#endif
cancel_upload = UPLOAD_ERROR_B;
} else if (blen > 0) {
- wlen = fwrite(buff, 1, blen, fp);
+ wlen = write(fd, buff, blen);
if (wlen < blen) {
#if DEBUG_FILE_UPLOAD
}
}
}
- if (fp) { /* may not be initialized if file could not be created */
- fclose(fp);
+ if (fd!=-1) { /* may not be initialized if file could not be created */
+ close(fd);
}
#if DEBUG_FILE_UPLOAD