Changeset 23255
- Timestamp:
- 01/03/2013 08:04:11 AM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-http.php
r23191 r23255 142 142 if ( $r['stream'] ) { 143 143 $r['blocking'] = true; 144 if ( ! is_writable( dirname( $r['filename'] ) ) )144 if ( ! wp_is_writable( dirname( $r['filename'] ) ) ) 145 145 return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) ); 146 146 } -
trunk/wp-includes/functions.php
r23254 r23255 1402 1402 return trailingslashit( rtrim( $temp, '\\' ) ); 1403 1403 1404 $is_win = ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) );1405 1406 1404 if ( function_exists('sys_get_temp_dir') ) { 1407 1405 $temp = sys_get_temp_dir(); 1408 if ( @is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) ) {1406 if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) 1409 1407 return trailingslashit( rtrim( $temp, '\\' ) ); 1410 }1411 1408 } 1412 1409 1413 1410 $temp = ini_get('upload_tmp_dir'); 1414 if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp )) )1411 if ( is_dir( $temp ) && wp_is_writable( $temp ) ) 1415 1412 return trailingslashit( rtrim( $temp, '\\' ) ); 1416 1413 1417 1414 $temp = WP_CONTENT_DIR . '/'; 1418 if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp )) )1415 if ( is_dir( $temp ) && wp_is_writable( $temp ) ) 1419 1416 return $temp; 1420 1417 1421 1418 $temp = '/tmp/'; 1422 1419 return $temp; 1420 } 1421 1422 /** 1423 * Determine if a directory is writable. 1424 * 1425 * This function is used to work around certain ACL issues 1426 * in PHP primarily affecting Windows Servers. 1427 * 1428 * @see win_is_writable() 1429 * 1430 * @since 3.6.0 1431 * 1432 * @param string $path 1433 * @return bool 1434 */ 1435 function wp_is_writable( $path ) { 1436 if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) 1437 return win_is_writable( $path ); 1438 else 1439 return @is_writable( $path ); 1423 1440 } 1424 1441
Note: See TracChangeset
for help on using the changeset viewer.