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

git-svn-id: https://develop.svn.wordpress.org/trunk@12519 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-12-23 16:22:26 +00:00
parent 3c37b8fe3a
commit f79d69c71b
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/';
}