Changeset 22008
- Timestamp:
- 09/26/2012 05:02:58 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r21996 r22008 1368 1368 /** 1369 1369 * Determines a writable directory for temporary files. 1370 * Function's preference is to WP_CONTENT_DIR followed by the return value of <code>sys_get_temp_dir()</code>, before finally defaulting to /tmp/ 1371 * 1372 * In the event that this function does not find a writable location, It may be overridden by the <code>WP_TEMP_DIR</code> constant in your <code>wp-config.php</code> file. 1370 * Function's preference is the return value of <code>sys_get_temp_dir()</code>, 1371 * followed by your PHP temporary upload directory, followed by WP_CONTENT_DIR, 1372 * before finally defaulting to /tmp/ 1373 * 1374 * In the event that this function does not find a writable location, 1375 * It may be overridden by the <code>WP_TEMP_DIR</code> constant in 1376 * your <code>wp-config.php</code> file. 1373 1377 * 1374 1378 * @since 2.5.0 … … 1384 1388 return trailingslashit($temp); 1385 1389 1390 $is_win = ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ); 1391 1392 if ( function_exists('sys_get_temp_dir') ) { 1393 $temp = sys_get_temp_dir(); 1394 if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) ) { 1395 return trailingslashit( $temp ); 1396 } 1397 } 1398 1399 $temp = ini_get('upload_tmp_dir'); 1400 if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) ) 1401 return trailingslashit($temp); 1402 1386 1403 $temp = WP_CONTENT_DIR . '/'; 1387 if ( is_dir( $temp) && @is_writable($temp) )1404 if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) ) 1388 1405 return $temp; 1389 1390 if ( function_exists('sys_get_temp_dir') ) {1391 $temp = sys_get_temp_dir();1392 if ( @is_writable($temp) )1393 return trailingslashit($temp);1394 }1395 1396 $temp = ini_get('upload_tmp_dir');1397 if ( is_dir($temp) && @is_writable($temp) )1398 return trailingslashit($temp);1399 1406 1400 1407 $temp = '/tmp/';
Note: See TracChangeset
for help on using the changeset viewer.