Changeset 22009 for trunk/wp-includes/functions.php
- Timestamp:
- 09/26/2012 05:08:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r22008 r22009 1407 1407 $temp = '/tmp/'; 1408 1408 return $temp; 1409 } 1410 1411 /** 1412 * Workaround for Windows bug in is_writable() function 1413 * 1414 * @since 2.8.0 1415 * 1416 * @param string $path 1417 * @return bool 1418 */ 1419 function win_is_writable( $path ) { 1420 /* will work in despite of Windows ACLs bug 1421 * NOTE: use a trailing slash for folders!!! 1422 * see http://bugs.php.net/bug.php?id=27609 1423 * see http://bugs.php.net/bug.php?id=30931 1424 */ 1425 1426 if ( $path[strlen( $path ) - 1] == '/' ) // recursively return a temporary file path 1427 return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp'); 1428 else if ( is_dir( $path ) ) 1429 return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' ); 1430 // check tmp file for read/write capabilities 1431 $should_delete_tmp_file = !file_exists( $path ); 1432 $f = @fopen( $path, 'a' ); 1433 if ( $f === false ) 1434 return false; 1435 fclose( $f ); 1436 if ( $should_delete_tmp_file ) 1437 unlink( $path ); 1438 return true; 1409 1439 } 1410 1440
Note: See TracChangeset
for help on using the changeset viewer.