Changeset 23254
- Timestamp:
- 01/03/2013 07:56:38 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r23229 r23254 1426 1426 * Workaround for Windows bug in is_writable() function 1427 1427 * 1428 * PHP has issues with Windows ACL's for determine if a 1429 * directory is writable or not, this works around them by 1430 * checking the ability to open files rather than relying 1431 * upon PHP to interprate the OS ACL. 1432 * 1433 * @see http://bugs.php.net/bug.php?id=27609 1434 * @see http://bugs.php.net/bug.php?id=30931 1435 * 1428 1436 * @since 2.8.0 1429 1437 * … … 1432 1440 */ 1433 1441 function win_is_writable( $path ) { 1434 /* will work in despite of Windows ACLs bug 1435 * NOTE: use a trailing slash for folders!!! 1436 * see http://bugs.php.net/bug.php?id=27609 1437 * see http://bugs.php.net/bug.php?id=30931 1438 */ 1439 1440 if ( $path[strlen( $path ) - 1] == '/' ) // recursively return a temporary file path 1442 1443 if ( $path[strlen( $path ) - 1] == '/' ) // if it looks like a directory, check a random file within the directory 1441 1444 return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp'); 1442 else if ( is_dir( $path ) ) 1445 else if ( is_dir( $path ) ) // If it's a directory (and not a file) check a random file within the directory 1443 1446 return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' ); 1447 1444 1448 // check tmp file for read/write capabilities 1445 1449 $should_delete_tmp_file = !file_exists( $path );
Note: See TracChangeset
for help on using the changeset viewer.