Patch #5065 » encode_wiki.diff
| migrate_from_trac.rake (working copy) | ||
|---|---|---|
| 551 | 551 |
wiki_edit_count += 1 |
| 552 | 552 |
print '.' |
| 553 | 553 |
STDOUT.flush |
| 554 |
p = wiki.find_or_new_page(page.name)
|
|
| 554 |
p = wiki.find_or_new_page(encode(page.name))
|
|
| 555 | 555 |
p.content = WikiContent.new(:page => p) if p.new_record? |
| 556 |
p.content.text = page.text
|
|
| 557 |
p.content.author = find_or_create_user(page.author) unless page.author.blank? || page.author == 'trac'
|
|
| 558 |
p.content.comments = page.comment
|
|
| 556 |
p.content.text = encode(page.text)
|
|
| 557 |
p.content.author = find_or_create_user(encode(page.author)) unless page.author.blank? || page.author == 'trac'
|
|
| 558 |
p.content.comments = encode(page.comment)
|
|
| 559 | 559 |
Time.fake(page.time) { p.new_record? ? p.save : p.content.save }
|
| 560 | 560 | |
| 561 | 561 |
next if p.content.new_record? |
| ... | ... | |
| 568 | 568 |
attachment.open {
|
| 569 | 569 |
a = Attachment.new :created_on => attachment.time |
| 570 | 570 |
a.file = attachment |
| 571 |
a.author = find_or_create_user(attachment.author)
|
|
| 572 |
a.description = attachment.description
|
|
| 571 |
a.author = find_or_create_user(encode(attachment.author))
|
|
| 572 |
a.description = encode(attachment.description)
|
|
| 573 | 573 |
a.container = p |
| 574 | 574 |
migrated_wiki_attachments += 1 if a.save |
| 575 | 575 |
} |