* [sup-devel] [PATCH] asciify untrusted strings before displaying in TextMode
@ 2010-01-19 21:48 Rich Lane
2010-01-23 12:55 ` William Morgan
0 siblings, 1 reply; 2+ messages in thread
From: Rich Lane @ 2010-01-19 21:48 UTC (permalink / raw)
To: sup-devel
---
lib/sup/modes/file-browser-mode.rb | 2 +-
lib/sup/modes/text-mode.rb | 2 +-
lib/sup/modes/thread-view-mode.rb | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/modes/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
index b92468d..72e12db 100644
--- a/lib/sup/modes/file-browser-mode.rb
+++ b/lib/sup/modes/file-browser-mode.rb
@@ -47,7 +47,7 @@ protected
return unless f && f.file?
begin
- BufferManager.spawn f.to_s, TextMode.new(f.read)
+ BufferManager.spawn f.to_s, TextMode.new(f.read.ascii)
rescue SystemCallError => e
BufferManager.flash e.message
end
diff --git a/lib/sup/modes/text-mode.rb b/lib/sup/modes/text-mode.rb
index 7c9e7d8..e772ff5 100644
--- a/lib/sup/modes/text-mode.rb
+++ b/lib/sup/modes/text-mode.rb
@@ -29,7 +29,7 @@ class TextMode < ScrollMode
end
if output
- BufferManager.spawn "Output of '#{command}'", TextMode.new(output)
+ BufferManager.spawn "Output of '#{command}'", TextMode.new(output.ascii)
else
BufferManager.flash "'#{command}' done!"
end
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index b08c819..0e935a4 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -613,7 +613,7 @@ EOS
end
if output
- BufferManager.spawn "Output of '#{command}'", TextMode.new(output)
+ BufferManager.spawn "Output of '#{command}'", TextMode.new(output.ascii)
else
BufferManager.flash "'#{command}' done!"
end
@@ -815,7 +815,7 @@ private
BufferManager.erase_flash
BufferManager.completely_redraw_screen
unless success
- BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s, chunk.filename)
+ BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s.ascii, chunk.filename)
BufferManager.flash "Couldn't execute view command, viewing as text."
end
end
--
1.5.6.5
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [sup-devel] [PATCH] asciify untrusted strings before displaying in TextMode
2010-01-19 21:48 [sup-devel] [PATCH] asciify untrusted strings before displaying in TextMode Rich Lane
@ 2010-01-23 12:55 ` William Morgan
0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2010-01-23 12:55 UTC (permalink / raw)
To: sup-devel
Applied to master and will go out in 0.10. Thanks!
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-23 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-19 21:48 [sup-devel] [PATCH] asciify untrusted strings before displaying in TextMode Rich Lane
2010-01-23 12:55 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox