Revert Revision 520; This is more thorough
This ensures that @page.name has the right (utf8) encoding.
This commit is contained in:
parent
d786e95a77
commit
6cf1463525
4 changed files with 6 additions and 3 deletions
|
@ -389,6 +389,7 @@ class WikiController < ApplicationController
|
|||
def load_page
|
||||
@page_name = params['id'] ? params['id'].purify : nil
|
||||
@page = @wiki.read_page(@web_name, @page_name) if @page_name
|
||||
@page.name.as_utf8 if @page
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -3,7 +3,7 @@ class Author < String
|
|||
attr_reader :name
|
||||
def initialize(name, ip = nil)
|
||||
@ip = ip
|
||||
super(name)
|
||||
super(name.as_utf8)
|
||||
end
|
||||
|
||||
def name=(value)
|
||||
|
|
|
@ -82,7 +82,7 @@ class Page < ActiveRecord::Base
|
|||
|
||||
# Returns the original wiki-word name as separate words, so "MyPage" becomes "My Page".
|
||||
def plain_name
|
||||
web.brackets_only? ? CGI.escapeHTML(name).as_utf8 : CGI.escapeHTML(WikiWords.separate(name)).as_utf8
|
||||
web.brackets_only? ? CGI.escapeHTML(name) : CGI.escapeHTML(WikiWords.separate(name))
|
||||
end
|
||||
|
||||
LOCKING_PERIOD = 30.minutes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue