Permalink
Browse files

fix encode bug in OpenSocialPlugin.pm

  • Loading branch information...
1 parent e7ce6dd commit f361a5d22ac7f1fa936b16c8f2023dc20c9f21f5 @soh335 soh335 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 f361a5d

Please sign in to comment.