#16864 Making invalid rename to fail.

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-11-24 14:10:33 -08:00
parent bce90313af
commit 2652425378
2 changed files with 7 additions and 4 deletions

View File

@@ -83,9 +83,11 @@ namespace Orchard.Media.Services {
}
public void RenameFile(string name, string newName, string folderName) {
if (FileAllowed(newName, false)) {
_storageProvider.RenameFile(_storageProvider.Combine(folderName, name), _storageProvider.Combine(folderName, newName));
if (!FileAllowed(newName, false)) {
throw new ArgumentException("New file name " + newName + " not allowed.");
}
_storageProvider.RenameFile(_storageProvider.Combine(folderName, name), _storageProvider.Combine(folderName, newName));
}
public string UploadMediaFile(string folderName, HttpPostedFileBase postedFile) {