Changeset 22009 for trunk/wp-admin/includes/misc.php
- Timestamp:
- 09/26/2012 05:08:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/misc.php
r21322 r22009 525 525 526 526 /** 527 * Workaround for Windows bug in is_writable() function528 *529 * @since 2.8.0530 *531 * @param string $path532 * @return bool533 */534 function win_is_writable( $path ) {535 /* will work in despite of Windows ACLs bug536 * NOTE: use a trailing slash for folders!!!537 * see http://bugs.php.net/bug.php?id=27609538 * see http://bugs.php.net/bug.php?id=30931539 */540 541 if ( $path[strlen( $path ) - 1] == '/' ) // recursively return a temporary file path542 return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');543 else if ( is_dir( $path ) )544 return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );545 // check tmp file for read/write capabilities546 $should_delete_tmp_file = !file_exists( $path );547 $f = @fopen( $path, 'a' );548 if ( $f === false )549 return false;550 fclose( $f );551 if ( $should_delete_tmp_file )552 unlink( $path );553 return true;554 }555 556 /**557 527 * Display the default admin color scheme picker (Used in user-edit.php) 558 528 *
Note: See TracChangeset
for help on using the changeset viewer.