Forráskód Böngészése

Revert "ZZZ"

This reverts commit bb3f7febce6e36be38f06fbcd2353f02f1311c0e.
Andy Baugh 6 éve
szülő
commit
181f08bbd4

+ 1 - 1
Makefile

@@ -63,7 +63,7 @@ depend-xmpp:
 	perl -MNet::XMPP -MMozilla::CA -e 'exit 0;' || sudo cpan -i Net::XMPP Mozilla::CA
 
 depend-notification-center:
-	perl -MFile::Slurper -MJSON::MaybeXS -e 'exit 0;' || sudo cpan -i File::Slurper JSON::MaybeXS
+	perl -MFile::Slurper -e 'exit 0;' || sudo cpan -i File::Slurper
 
 depend-all: depend-xmpp depend-irc depend-notification-center
 

+ 6 - 3
lib/Cpanel/iContact/Provider/Local.pm

@@ -68,6 +68,10 @@ sub send {
 	my $html    = ${ $args_hr->{'html_body'} };
 	$html =~ s:src=".*":src="/unprotected/cpanel/images/cp-logo.svg" style="width\:3rem":;
 
+	require Text::Iconv;
+	my $converter = Text::Iconv->new("UTF-8", "ASCII");
+	$html = $converter->convert($html);
+
     # Send it
     my $time = time;
     $time =~ tr/ /-/;
@@ -85,10 +89,9 @@ sub send {
                 };
             }
         }
-	    require JSON::MaybeXS;
+	    require Cpanel::AdminBin::Serializer;
         require File::Slurper;
-		my $encoder = JSON::MaybeXS->new( utf8 => 1 );
-        File::Slurper::write_binary( $file, $encoder->encode( { 'subject' => $subject, 'text' => $text, 'html' => $html } ) );
+        File::Slurper::write_binary( $file, Cpanel::AdminBin::Serializer::Dump( { 'subject' => $subject, 'text' => $text, 'html' => $html } ) );
     }
     catch {
         require Cpanel::Exception;

+ 2 - 3
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 JSON::MaybeXS				      ();
+use Cpanel::AdminBin::Serializer      ();
 use File::Slurper                     ();
 
 =encoding utf-8
@@ -92,8 +92,7 @@ sub get_notice {
 	my ( $time, %opts ) = @_;
 	local $/;
 	my $file = $Cpanel::iContact::Provider::Local::DIR . "/$opts{'user'}/$time.json";
-    my $decoder = JSON::MaybeXS->new( utf8 => 1 );
-    return $decoder->decode(File::Slurper::read_binary($file));
+    return Cpanel::AdminBin::Serializer::Load(File::Slurper::read_binary($file));
 }
 
 =head2 get_all_notices