Fixed and closed #467: names of new items are now trimmed before saving or renaming.
This commit is contained in:
parent
121f90fd9b
commit
f8e410bf6a
12 changed files with 35 additions and 2 deletions
|
@ -262,6 +262,8 @@ namespace ScrewTurn.Wiki {
|
|||
if(canDelete) {
|
||||
lblRenameResult.Text = "";
|
||||
|
||||
txtNewName.Text = txtNewName.Text.Trim();
|
||||
|
||||
// Ensure that the extension is not changed (security)
|
||||
string previousExtension = Path.GetExtension(lblItem.Text);
|
||||
string newExtension = Path.GetExtension(txtNewName.Text);
|
||||
|
@ -274,6 +276,8 @@ namespace ScrewTurn.Wiki {
|
|||
txtNewName.Text += previousExtension;
|
||||
}
|
||||
|
||||
txtNewName.Text = txtNewName.Text.Trim();
|
||||
|
||||
bool done = true;
|
||||
if(txtNewName.Text.ToLowerInvariant() != lblItem.Text.ToLowerInvariant()) {
|
||||
done = provider.RenamePageAttachment(CurrentPage, lblItem.Text, txtNewName.Text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue