Ticket #20778: 207778-sw.diff
File 207778-sw.diff, 1.3 KB (added by , 12 years ago) |
---|
-
wp-includes/functions.php
1363 1363 1364 1364 /** 1365 1365 * Determines a writable directory for temporary files. 1366 * 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/1366 * Function's preference is the return value of <code>sys_get_temp_dir()</code>, followed by WP_CONTENT_DIR, before finally defaulting to /tmp/ 1367 1367 * 1368 1368 * 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. 1369 1369 * … … 1379 1379 if ( $temp ) 1380 1380 return trailingslashit($temp); 1381 1381 1382 $temp = WP_CONTENT_DIR . '/';1383 if ( is_dir($temp) && @is_writable($temp) )1384 return $temp;1385 1386 1382 if ( function_exists('sys_get_temp_dir') ) { 1387 1383 $temp = sys_get_temp_dir(); 1388 1384 if ( @is_writable($temp) ) 1389 1385 return trailingslashit($temp); 1390 1386 } 1391 1387 1388 $temp = WP_CONTENT_DIR . '/'; 1389 if ( is_dir($temp) && @is_writable($temp) ) 1390 return $temp; 1391 1392 1392 $temp = ini_get('upload_tmp_dir'); 1393 1393 if ( is_dir($temp) && @is_writable($temp) ) 1394 1394 return trailingslashit($temp);