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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: TFATitleSubpageCreator: * Move to AnomieBOT II * Approved SourceUploader: * Add a new bit of metadata, with a new column in the output. All: * Add the new metadata field.
AnomieBOT (talk | contribs)
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>.
 
(3 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]]}}
<sourcesyntaxhighlight lang="perl">
package tasks::SafesubstFixer;
 
Line 11:
BRFA: Wikipedia:Bots/Requests for approval/AnomieBOT 37
Status: Approved 2010-05-05
Rate: Max 6 edits/minute
Created: 2010-04-20
OnDemand: true
Line 57 ⟶ 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 101 ⟶ 100:
 
# Get page text
my $intxt=$tok->{'revisions'}[0]{'slots'}{'main'}{'*'};
 
# Perform the replacements
Line 139 ⟶ 138:
1;
 
</syntaxhighlight>
</source>