Check upload_tmp_dir ini settings for a usable temporary path. Props Denis-de-Bernardy. fixes #6699

git-svn-id: http://svn.automattic.com/wordpress/trunk@12519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-12-23 16:22:26 +00:00
parent adb37768c6
commit b9dfd1fb4a
1 changed files with 4 additions and 0 deletions

View File

@ -155,6 +155,10 @@ function get_temp_dir() {
if ( function_exists('sys_get_temp_dir') )
return trailingslashit(sys_get_temp_dir());
$temp = ini_get('upload_tmp_dir');
if ( is_dir($temp) ) // always writable
return trailingslashit($temp);
return '/tmp/';
}