summaryrefslogtreecommitdiffstats
path: root/app/models/wiki.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-15 17:31:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-15 17:31:01 +0000
commita5849ee044837be589e9aae554cf99a394b9b9af (patch)
treea62c40857d190be3c38105bc8a3179b3a6419568 /app/models/wiki.rb
parent38e0c237a448c5d59caad9c6bab8461c7a118c09 (diff)
downloadredmine-a5849ee044837be589e9aae554cf99a394b9b9af.tar.gz
redmine-a5849ee044837be589e9aae554cf99a394b9b9af.zip
Wiki links can now refer other project wikis, using this syntax:
[[project:]] -> wiki starting page [[project:page]] [[project:page|text]] where 'project' is the project name or identifier. git-svn-id: http://redmine.rubyforge.org/svn/trunk@643 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki.rb')
-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 8d461a85b..ed473c7c0 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -20,7 +20,7 @@ class Wiki < ActiveRecord::Base
has_many :pages, :class_name => 'WikiPage', :dependent => :destroy
validates_presence_of :start_page
- validates_format_of :start_page, :with => /^[^,\.\/\?\;\|]*$/
+ validates_format_of :start_page, :with => /^[^,\.\/\?\;\|\:]*$/
# find the page with the given title
# if page doesn't exist, return a new page
@@ -38,9 +38,9 @@ class Wiki < ActiveRecord::Base
# turn a string into a valid page title
def self.titleize(title)
# replace spaces with _ and remove unwanted caracters
- title = title.gsub(/\s+/, '_').delete(',./?;|') if title
+ title = title.gsub(/\s+/, '_').delete(',./?;|:') if title
# upcase the first letter
- title = title[0..0].upcase + title[1..-1] if title
+ title = (title.length > 1 ? title.first.upcase + title[1..-1] : title.upcase) if title
title
end
end