Merged fix for unclean oldname from renaming ... from stable.

This commit is contained in:
moodler 2004-09-28 08:05:18 +00:00
parent 7a5672c90c
commit 8ef1e12f74
4 changed files with 8 additions and 4 deletions

View File

@ -210,7 +210,8 @@
case "rename":
if (!empty($name)) {
html_header($course, $wdir);
$name = clean_filename($name);
$name = clean_filename($name);
$oldname = clean_filename($oldname);
if (file_exists($basedir.$wdir."/".$name)) {
echo "Error: $name already exists!";
} else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {

View File

@ -298,7 +298,8 @@
case "rename":
if (!empty($name)) {
html_header($course, $wdir);
$name = clean_filename($name);
$name = clean_filename($name);
$oldname = clean_filename($oldname);
if (file_exists($basedir.$wdir."/".$name)) {
echo "Error: $name already exists!";
} else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {

View File

@ -217,7 +217,8 @@
case "rename":
if (!empty($name)) {
html_header($course, $wdir);
$name = clean_filename($name);
$name = clean_filename($name);
$oldname = clean_filename($oldname);
if (file_exists($basedir.$wdir."/".$name)) {
echo "Error: $name already exists!";
} else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {

View File

@ -217,7 +217,8 @@
case "rename":
if (!empty($name)) {
html_header($course, $wdir);
$name = clean_filename($name);
$name = clean_filename($name);
$oldname = clean_filename($oldname);
if (file_exists($basedir.$wdir."/".$name)) {
echo "Error: $name already exists!";
} else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {