Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2010-01-24 12:27:06 -06:00
commit 61a52a91e1
3 changed files with 4 additions and 4 deletions

View file

@ -96,7 +96,7 @@ require 'stringsupport'
# Performs HTML escaping on text, but keeps linefeeds intact (by replacing them with <br/>) # Performs HTML escaping on text, but keeps linefeeds intact (by replacing them with <br/>)
def escape_preserving_linefeeds(text) def escape_preserving_linefeeds(text)
h(text).gsub(/\n/, '<br/>') h(text).gsub(/\n/, '<br/>').as_utf8
end end
def format_date(date, include_time = true) def format_date(date, include_time = true)

View file

@ -108,7 +108,7 @@ class Page < ActiveRecord::Base
end end
def to_param def to_param
name name.as_utf8
end end
private private

View file

@ -78,7 +78,7 @@ class WikiReference < ActiveRecord::Base
"AND wiki_references.link_type = '#{REDIRECTED_PAGE}' " + "AND wiki_references.link_type = '#{REDIRECTED_PAGE}' " +
"AND pages.web_id = '#{web.id}'" "AND pages.web_id = '#{web.id}'"
row = connection.select_one(sanitize_sql([query, page_name])) row = connection.select_one(sanitize_sql([query, page_name]))
row['name'] if row row['name'].as_utf8 if row
end end
def self.pages_in_category(web, category) def self.pages_in_category(web, category)
@ -88,7 +88,7 @@ class WikiReference < ActiveRecord::Base
"WHERE wiki_references.referenced_name = ? " + "WHERE wiki_references.referenced_name = ? " +
"AND wiki_references.link_type = '#{CATEGORY}' " + "AND wiki_references.link_type = '#{CATEGORY}' " +
"AND pages.web_id = '#{web.id}'" "AND pages.web_id = '#{web.id}'"
names = connection.select_all(sanitize_sql([query, category])).map { |row| row['name'] } names = connection.select_all(sanitize_sql([query, category])).map { |row| row['name'].as_utf8 }
end end
def self.list_categories(web) def self.list_categories(web)