From e9b6a1018db89fb23d6e52e529f80ce11da09bd0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Oct 2011 01:27:04 +0200 Subject: [PATCH] remove unneeded definiton of get_temp_dir --- apps/user_openid/phpmyid.php | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index c984dc8f5e..ef01e7a046 100644 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -1373,41 +1373,6 @@ function str_diff_at ($a, $b) { return $n; } - -if (! function_exists('get_temp_dir')) { -/** - * Create function if missing - * @return string - */ - if (ini_get('open_basedir') == false) { - function get_temp_dir () { - $keys = array('TMP', 'TMPDIR', 'TEMP'); - foreach ($keys as $key) { - if (isset($_ENV[$key]) && is_dir($_ENV[$key]) && is_writable($_ENV[$key])) - return realpath($_ENV[$key]); - } - - $tmp = tempnam(false, null); - if (file_exists($tmp)) { - $dir = realpath(dirname($tmp)); - unlink($tmp); - return realpath($dir); - } - - return realpath(dirname(__FILE__)); - } - } - else { - function get_temp_dir () { - if (isset(ini_get('upload_tmp_dir')) && is_dir(ini_get('upload_tmp_dir')) && is_writable(ini_get('upload_tmp_dir'))) - return ini_get('upload_tmp_dir'); - else - return realpath(dirname(__FILE__)); - } - } -} - - /** * Determine if a child URL actually decends from the parent, and that the * parent is a good URL.