﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
22900	is_writable function fails on Windows systems causing spurious http_request_failed error	Otto42		"In class-http.php, in request(), there is a double check to be sure a file is writable using this code:

{{{
$r['filename'] = get_temp_dir() . basename( $url );

...

if ( ! is_writable( dirname( $r['filename'] ) ) )
	return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );
}}}

Problem is that is_writable can return false incorrectly on Windows systems, due to a PHP bug:
https://bugs.php.net/bug.php?id=30931

Now, get_temp_dir() already performs an is_writable check on the resulting temp directories, and it uses a win_is_writable() call to work around this problem on Windows systems.

Thus, this secondary check is seemingly unnecessary anyway, anything returned by get_temp_dir() really should be writable.

So either the writable check in class-http.php needs to be made Windows compatible, or removed entirely.

A few reports of the problem on support forums:
* http://wordpress.org/support/topic/plugin-upgrades-fail-after-update-to-wp-35?replies=6
* http://wordpress.org/support/topic/plugin-update-not-writeable?replies=14
* http://wordpress.org/support/topic/download-failed-destination-directory-for-file-streaming-does-not-exist?replies=2

This problem may have been exacerbated by #20778.
"	defect (bug)	closed	normal	3.5.1	HTTP	3.5	normal	fixed	has-patch commit	knut@… phill@… kurtpayne
