OSDN Git Service

Model::Util: fix clean_html and escape_html method
authorhylom <hylom@users.sourceforge.jp>
Thu, 27 Oct 2016 13:13:28 +0000 (22:13 +0900)
committerhylom <hylom@users.sourceforge.jp>
Thu, 27 Oct 2016 13:13:28 +0000 (22:13 +0900)
src/newslash_web/lib/Newslash/Model/Util.pm

index 6e0e445..8a0b5f5 100644 (file)
@@ -7,7 +7,7 @@ use Mojo::Log;
 use Newslash::Model::EscapeHTML qw();
 use HTML::Tidy;
 
-=head2 clean_html($html, \%allowed)
+=head2 clean_html(\%allowed, $html)
 
 escape and tidy HTML
 
@@ -36,8 +36,8 @@ tidied HTML
 =cut
 
 sub clean_html {
-    my ($self, $html, $allowed) = @_;
-    my $escaped = escape_html($allowed, $html);
+    my ($self, $allowed, $html) = @_;
+    my $escaped = $self->escape_html($allowed, $html);
     $escaped = EscapeHTML::blank_line_to_paragraph($escaped);
 
     my $tidy = HTML::Tidy->new( {
@@ -50,7 +50,7 @@ sub clean_html {
 }
 
 
-=head2 escape_html($html, \%allowed)
+=head2 escape_html(\%allowed, $html)
 
 escape  HTML
 
@@ -79,7 +79,7 @@ escaped HTML
 =cut
 
 sub escape_html {
-    my ($self, $html, $allowed) = @_;
+    my ($self, $allowed, $html) = @_;
     return EscapeHTML::escape_html($allowed, $html);
 }