Rename the $rm variable so that the logic in win_is_writable() makes more sense

git-svn-id: https://develop.svn.wordpress.org/trunk@16623 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2010-11-30 19:57:39 +00:00
parent 8a45977efc
commit 757aeb2121
1 changed files with 3 additions and 3 deletions

View File

@ -567,7 +567,7 @@ function saveDomDocument($doc, $filename) {
* *
* @since 2.8.0 * @since 2.8.0
* *
* @param object $path * @param string $path
* @return bool * @return bool
*/ */
function win_is_writable( $path ) { function win_is_writable( $path ) {
@ -582,12 +582,12 @@ function win_is_writable( $path ) {
else if ( is_dir( $path ) ) else if ( is_dir( $path ) )
return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' ); return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
// check tmp file for read/write capabilities // check tmp file for read/write capabilities
$rm = file_exists( $path ); $should_delete_tmp_file = !file_exists( $path );
$f = @fopen( $path, 'a' ); $f = @fopen( $path, 'a' );
if ( $f === false ) if ( $f === false )
return false; return false;
fclose( $f ); fclose( $f );
if ( ! $rm ) if ( $should_delete_tmp_file )
unlink( $path ); unlink( $path );
return true; return true;
} }