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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: SafesubstFixer: * New task, BRFA filed.
 
AnomieBOT (talk | contribs)
Updating published sources: SafesubstFixer: * Fix nested <includeonly&g;s
Line 108:
$outtxt=~s/$search/$repl/g;
}
$outtxt=~s!<includeonly>(.*?)</includeonly>! fix_nested_noinclude($1) !ge;
$outtxt=$api->replace_nowiki($outtxt, $nowiki);
 
Line 127 ⟶ 128:
# No more pages to check
return undef;
}
 
sub fix_nested_noinclude {
my $x=shift;
return $x=~/(.*)<includeonly>safesubst:/ ? "<includeonly>${1}safesubst:</includeonly><includeonly>" : "<includeonly>$x</includeonly>";
}