summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-27 11:14:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-27 11:14:28 +0000
commit97140f6a7828ff3f2eed25de1553a92ee67f4c24 (patch)
tree2a4f5715d5efa379f172a6e6907f917a253d37b7 /app/models
parent4a6a551d074ce0680540a28f7c393733afa43422 (diff)
downloadredmine-97140f6a7828ff3f2eed25de1553a92ee67f4c24.tar.gz
redmine-97140f6a7828ff3f2eed25de1553a92ee67f4c24.zip
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
Diffstat (limited to 'app/models')
-rw-r--r--app/models/wiki.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index 9bd245955..b28694ec4 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -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