Content deleted Content added
Updating published sources: SafesubstFixer: * Approved! |
Updating published sources: General: * Update for the addition of 'rvslots'. DatedCategoryDeleterTest: * Disable. It's clear that task won't be needed. BrokenRedirectDeleter: * Handle pages with newlines before the <code>#REDIRECT</code>. |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1:
{{ombox|type=notice|text= BRFA approved 2010-05-05<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 37]]}}
<
package tasks::SafesubstFixer;
Line 7:
=begin metadata
Bot: AnomieBOT
Task: SafesubstFixer
BRFA: Wikipedia:Bots/Requests for approval/AnomieBOT 37
Status: Approved 2010-05-05
Created: 2010-04-20
OnDemand: true
Replace <code><nowiki>{{{subst|}}}</nowiki></code> in specifically named templates with <code><nowiki><includeonly>safesubst:</includeonly></nowiki></code>. If appropriate, may also insert <code><nowiki><includeonly>safesubst:</includeonly></nowiki></code> into <code><nowiki>{{#if</nowiki></code> and other parser functions, or specifically named template invocations.
Line 41 ⟶ 42:
sub approved {
return -1;
}
Line 55 ⟶ 56:
# Replacements
my @re=(
qr/\{\{\{subst\|\}\}\}/, '<includeonly>safesubst:</includeonly>',
qr/\{\{#if/, '{{<includeonly>safesubst:</includeonly>#if',
qr/\{\{#switch/, '{{<includeonly>safesubst:</includeonly>#switch',
);
my $summary="Replacing {{{subst|}}} with <includeonly>safesubst:</includeonly> (and inserting it into parser function calls) per [[Wikipedia talk:Template messages/User talk namespace#safesubst:|request]]";
Line 99 ⟶ 100:
# Get page text
my $intxt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
# Perform the replacements
Line 137 ⟶ 138:
1;
</syntaxhighlight>
|