Make the template editor use the home setting to find the index.

git-svn-id: https://develop.svn.wordpress.org/trunk@1392 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-06-08 03:40:17 +00:00
parent 5e0bb09d82
commit e0ce2dbd0f
1 changed files with 9 additions and 2 deletions

View File

@ -96,8 +96,15 @@ default:
}
}
$file = validate_file($file);
$real_file = '../' . $file;
$home = get_settings('home');
if ($home != '' && ('index.php' == $file || get_settings('blogfilename') == $file)) {
$home_root = str_replace('http://', '', $home);
$home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root);
$real_file = $_SERVER['DOCUMENT_ROOT'] . $home_root . '/' . $file;
} else {
$file = validate_file($file);
$real_file = '../' . $file;
}
if (!is_file($real_file))
$error = 1;