Content deleted Content added
Updating published sources: General: * Fix newline handling in log messages. |
Updating published sources: AFDMergeFromCleaner: * Don't count it as a problem when A redirects to C where it is "supposed" to redirect to B if B is a redirect to C. diff.pl: * Open the pipe as utf8 so diffs don't have mangled characters. |
||
Line 51:
my $res;
$api->task('AFDMergeFromCleaner', 0, 10, qw/d::Templates d::Redirects/);
if($self->{'nextrun'}==0 && exists($api->store->{'nextrun'})){
Line 114:
} else {
$subject=~s/^([^:]*) talk:/$1:/;
}
$res=$api->query(titles => $subject, redirects=>1);
if($res->{'code'} ne 'success'){
$api->warn("Failed to retrieve redirect target for $subject: ".$res->{'error'}."\n");
$ret=60;
last MAINLOOP;
}
my $rsubject=$subject;
foreach (@{$res->{'query'}{'redirects'}}){
$rsubject=$_->{'to'} if($_->{'from'} eq $rsubject);
}
Line 165 ⟶ 176:
foreach (@{$res->{'query'}{'redirects'}}){
my ($f,$t)=($_->{'from'}, $_->{'to'});
if($t eq $subject || $t eq $rsubject){
$f=$norm{$f} if exists($norm{$f});
$remove{$f}=1;
} elsif($subject ne $rsubject){
$redirected{"$f>$rsubject>$t"}="| {{$linktmpl|$f}} || {{$linktmpl|$subject}}<br />→ {{$linktmpl|$rsubject}} || {{$linktmpl|$t}} || ";
} else {
$redirected{"$f>$subject>$t"}="| {{$linktmpl|$f}} || {{$linktmpl|$subject}} || {{$linktmpl|$t}} || ";
|