User:AnomieBOT/source/tasks/TFDTemplateSubster.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: d/Redirects.pm: * <code>redirects_to()</code> should still normalize input. TFDTemplateSubster: * Handle normalization from the above change.
AnomieBOT (talk | contribs)
Updating published sources: TFDTemplateSubster: * Don't do <code>JSON->utf8</code>. AnomieBOT::API returns and expects Unicode strings, not utf8-encoded strings.
 
Line 170:
if ( $status->[0] < $revid ) {
eval {
$status->[1] = JSON->new->utf8->decode( $tok->{'revisions'}[0]{'slots'}{'main'}{'*'} // '' );
};
$status->[1] = {} unless ref( $status->[1] ) eq 'HASH';
Line 194:
if ( $writeStatus ) {
$api->log( "Updating processing status page" );
my $outtxt = JSON->new->utf8->pretty->canonical->encode( \%process );
my $res2 = $api->edit( $tok, $outtxt, 'Updating status page', 1, 1, contentmodel => 'json' );
if ( $res2->{'code'} eq 'success' ) {