瀏覽代碼

Just throw something at the wall, see if it sticks

Andy Baugh 6 年之前
父節點
當前提交
67853a495e
共有 2 個文件被更改,包括 7 次插入12 次删除
  1. 5 10
      lib/Cpanel/iContact/Provider/Local.pm
  2. 2 2
      lib/Cpanel/iContact/Provider/Local/Getter.pm

+ 5 - 10
lib/Cpanel/iContact/Provider/Local.pm

@@ -63,14 +63,9 @@ sub send {
 
     my @errs;
 
-    my $subject_copy = $args_hr->{'subject'};
-    my $text_copy    = ${ $args_hr->{'text_body'} };
-    my $html_copy    = ${ $args_hr->{'html_body'} };
-
-    require Encode;
-    my $subject = Encode::decode_utf8( $subject_copy, $Encode::FB_QUIET );
-    my $text    = Encode::decode_utf8( $text_copy, $Encode::FB_QUIET );
-    my $html    = Encode::decode_utf8( $html_copy, $Encode::FB_QUIET );
+    my $subject = $args_hr->{'subject'};
+    my $text    = ${ $args_hr->{'text_body'} };
+	my $html    = ${ $args_hr->{'html_body'} };
 
     # Send it
     my $time = time;
@@ -89,9 +84,9 @@ sub send {
                 };
             }
         }
-	    require Cpanel::JSON::XS;
+	    require Cpanel::AdminBin::Serializer;
         open( my $fh, ">", $file ) || die "Couldn't open '$file': $!";
-        print $fh Cpanel::JSON::XS::encode_json( { 'subject' => $subject, 'text' => $text, 'html' => $html } );
+        print $fh Cpanel::AdminBin::Serializer::Dump( { 'subject' => $subject, 'text' => $text, 'html' => $html } );
         close $fh;
     }
     catch {

+ 2 - 2
lib/Cpanel/iContact/Provider/Local/Getter.pm

@@ -5,7 +5,7 @@ use warnings;
 
 # Specifically for the constant that is the dir
 use Cpanel::iContact::Provider::Local ();
-use Cpanel::JSON::XS                  ();
+use Cpanel::AdminBin::Serializer      ();
 
 =encoding utf-8
 
@@ -92,7 +92,7 @@ sub get_notice {
 	local $/;
 	my $file = $Cpanel::iContact::Provider::Local::DIR . "/$opts{'user'}/$time.json";
 	open my $fh, '<', $file or die "can't open $file: $!";
-    return Cpanel::JSON::XS::decode_json(<$fh>);
+    return Cpanel::AdminBin::Serializer::Load(<$fh>);
 }
 
 =head2 get_all_notices