Prevent Renaming to a Null Page Name
Fix http://rubyforge.org/tracker/index.php?func=detail&aid=27649&group_id=186&atid=783
This commit is contained in:
parent
c8ef0a3dd4
commit
d67ce28855
2 changed files with 3 additions and 1 deletions
|
@ -273,6 +273,7 @@ class WikiController < ApplicationController
|
|||
cookies['author'] = { :value => author_name.dup.as_bytes, :expires => Time.utc(2030) }
|
||||
if @page
|
||||
new_name = params['new_name'] ? params['new_name'].purify : @page_name
|
||||
new_name = @page_name if new_name.empty?
|
||||
prev_content = @page.current_revision.content
|
||||
raise Instiki::ValidationError.new('Your new title cannot contain a "."') if new_name.include? '.'
|
||||
raise Instiki::ValidationError.new('A page named "' + new_name.escapeHTML + '" already exists.') if
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue