remove unneeded definiton of get_temp_dir

This commit is contained in:
Robin Appelman 2011-10-20 01:27:04 +02:00
parent 8f77179d29
commit e9b6a1018d
1 changed files with 0 additions and 35 deletions

View File

@ -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.