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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Improve formatting of the created redirect.
AnomieBOT (talk | contribs)
Updating published sources: EnDashRedirectCreator: * Update old redirects when the existing templates are now invalid due to a move of the redirect. `
Line 252:
my $txt = $tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
if ( $txt =~ m!\{\{User:AnomieBOT/Auto-G8\|target=(.*?)\}\}! && $1 ne $origtarget ) {
my $api->warn("[[$redir]]oldtarget apparently= exists for both [[$1]] and [[$origtarget]], not updating");
nextmy $tmp = $oldtarget;
$tmp =~ s/[$dashstr]/-/gu;
if ( $tmp eq $redir ) {
$api->warn("[[$redir]] apparently exists for both [[$oldtarget]] and [[$origtarget]], not updating");
next;
}
$api->warn("[[$redir]] claims to exist for [[$oldtarget]], but that's not valid so overwriting");
}
}