From b9dfd1fb4a9a52e173d4d71c8fe2fab14c81c819 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 23 Dec 2009 16:22:26 +0000 Subject: [PATCH] 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 --- wp-admin/includes/file.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 2bb211ea36..907041e21d 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -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/'; }