Defect #5129 ยป issues_controller_backslash_escape_fix.diff
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
text = @issue.description
|
||
|
end
|
||
|
content = "#{ll(Setting.default_language, :text_user_wrote, user)}\\n> "
|
||
|
content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n"
|
||
|
content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('\\', '\\\\\\\\').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n"
|
||
|
render(:update) { |page|
|
||
|
page.<< "$('notes').value = \"#{content}\";"
|
||
|
page.show 'update'
|
||