summaryrefslogtreecommitdiffstats
path: root/app/models/wiki.rb
diff options
context:
space:
mode:
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