Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
d61ae49e66
5 changed files with 9 additions and 8 deletions
|
@ -141,7 +141,7 @@ class AdminController < ApplicationController
|
|||
private
|
||||
|
||||
def is_post
|
||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||
unless (request.post? || Rails.env.test?)
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
|
||||
return false
|
||||
|
|
|
@ -111,7 +111,7 @@ class FileController < ApplicationController
|
|||
private
|
||||
|
||||
def is_post
|
||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||
unless (request.post? || Rails.env.test?)
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
|
||||
return false
|
||||
|
|
|
@ -280,7 +280,7 @@ EOL
|
|||
|
||||
def save
|
||||
render(:status => 404, :text => 'Undefined page name', :layout => 'error') and return if @page_name.nil?
|
||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||
unless (request.post? || Rails.env.test?)
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
|
||||
return
|
||||
|
|
|
@ -9,7 +9,7 @@ class WikiFile < ActiveRecord::Base
|
|||
validates_length_of :description, :maximum=>255
|
||||
|
||||
def self.find_by_file_name(file_name)
|
||||
find(:first, :conditions => ['file_name = ?', file_name])
|
||||
first(:conditions => ['file_name = ?', file_name])
|
||||
end
|
||||
|
||||
SANE_FILE_NAME = /^[a-zA-Z0-9\-_\. ]*$/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue