Fix a Ruby 1.9 Character Encoding Bug

Wow, this stuff is complicated!
Some things really want to be UTF-8;
others really want to be byte strings.
This commit is contained in:
Jacques Distler 2009-12-01 12:03:15 -06:00
parent e3832c6f79
commit 34b63a8375
3 changed files with 16 additions and 4 deletions

View file

@ -270,7 +270,7 @@ class WikiController < ApplicationController
prev_content = ''
filter_spam(the_content)
raise Instiki::ValidationError.new('Your name cannot contain a "."') if author_name.include? '.'
cookies['author'] = { :value => author_name, :expires => Time.utc(2030) }
cookies['author'] = { :value => author_name.dup.as_bytes, :expires => Time.utc(2030) }
if @page
new_name = params['new_name'] ? params['new_name'].purify : @page_name
prev_content = @page.current_revision.content