Permalink
Browse files

Merge pull request #4 from soh335/fix-encode-feature/opensocial

Fix encode feature/opensocial
  • Loading branch information...
2 parents e7ce6dd + f361a5d commit acff69e9493f370152070ccc9b779329f304b111 @shin1rosei committed Mar 13, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Moxy/Plugin/OpenSocial.pm
@@ -6,6 +6,7 @@ use base 'Moxy::Plugin';
use URI::Escape;
use OAuth::Lite::Consumer;
use HTML::TreeBuilder;
+use Encode;
sub control_panel :Hook {
my ($self, $context, $args) = @_;
@@ -94,7 +95,7 @@ sub response_filter :Hook {
$tree->implicit_tags(0);
$tree->no_space_compacting(1);
$tree->ignore_ignorable_whitespace(0);
- #$tree->store_comments(1);
+ $tree->store_comments(1);
$tree->ignore_unknown(0);
$tree->parse_content($res->decoded_content);
@@ -119,7 +120,7 @@ sub response_filter :Hook {
}
}
- $res->content( $tree->as_HTML );
+ $res->content( encode( $res->charset, $tree->as_HTML(q{<>"&'}, '', {}) ));
$tree->delete;
}
}

0 comments on commit acff69e

Please sign in to comment.