Fixed: Wiki#find_page should not be case sensitive because page title uniqueness is not (#6987).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4430 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+3
-3
@@ -45,11 +45,11 @@ class Wiki < ActiveRecord::Base
|
||||
# find the page with the given title
|
||||
def find_page(title, options = {})
|
||||
title = start_page if title.blank?
|
||||
title = Wiki.titleize(title)
|
||||
page = pages.find_by_title(title)
|
||||
title = Wiki.titleize(title).downcase
|
||||
page = pages.first(:conditions => ["LOWER(title) LIKE ?", title])
|
||||
if !page && !(options[:with_redirect] == false)
|
||||
# search for a redirect
|
||||
redirect = redirects.find_by_title(title)
|
||||
redirect = redirects.first(:conditions => ["LOWER(title) LIKE ?", title])
|
||||
page = find_page(redirect.redirects_to, :with_redirect => false) if redirect
|
||||
end
|
||||
page
|
||||
|
||||
Reference in New Issue
Block a user