Ticket #20778: 20778.patch
File 20778.patch, 1.7 KB (added by , 12 years ago) |
---|
-
wp-includes/functions.php
1364 1364 1365 1365 /** 1366 1366 * Determines a writable directory for temporary files. 1367 * Function's preference is t o WP_CONTENT_DIR followed by the return value of <code>sys_get_temp_dir()</code>, before finally defaulting to /tmp/1367 * Function's preference is the return value of <code>sys_get_temp_dir()</code>, followed by WP_CONTENT_DIR, before finally defaulting to /tmp/ 1368 1368 * 1369 1369 * 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 1370 * … … 1380 1380 if ( $temp ) 1381 1381 return trailingslashit($temp); 1382 1382 1383 $temp = WP_CONTENT_DIR . '/';1384 if ( is_dir($temp) && @is_writable($temp) )1385 return $temp;1386 1387 1383 if ( function_exists('sys_get_temp_dir') ) { 1388 $temp = sys_get_temp_dir(); 1389 if ( @is_writable($temp) ) 1390 return trailingslashit($temp); 1384 $_temp = sys_get_temp_dir(); 1385 if ( ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) && win_is_writable( $_temp ) ) || @is_writable( $_temp ) ) { 1386 $temp = $_temp; 1387 return trailingslashit( $temp ); 1388 } 1391 1389 } 1392 1390 1393 1391 $temp = ini_get('upload_tmp_dir'); 1394 if ( is_dir( $temp) && @is_writable($temp) )1392 if ( is_dir( $temp ) && ( ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) && win_is_writable( $temp ) ) || @is_writable( $temp ) ) ) 1395 1393 return trailingslashit($temp); 1396 1394 1395 $temp = WP_CONTENT_DIR . '/'; 1396 if ( is_dir( $temp ) && ( ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) && win_is_writable( $temp ) ) || @is_writable( $temp ) ) ) 1397 return $temp; 1398 1397 1399 $temp = '/tmp/'; 1398 1400 return $temp; 1399 1401 }