Szerkesztő:GumiBot/code48
Megjelenés
A(z) 48. kódú hibát javító kódrészlet
[szerkesztés]sub fix_48 { # Title in text
my ($error_code, $title_str, $text_str) = @_;
(my $re_str = $title_str) =~ s/_/ /g;
$re_str =~ s/([().{}\\\|+?*^\$])/\\$1/g;
return ('Atiranyitas')
if $text_str =~ /^#(REDIRECT|$redirect_str) +\[\[$re_str\]\]/i;
my $count = 0;
$count += $text_str =~
s/'''\[\[($re_str)\]\]([[:alpha:]]*)'''/'''$1$2'''/igs;
$count += $text_str =~
s/'''\[\[$re_str\|(.+?)\]\]([[:alpha:]]*)'''/'''$1$2'''/igs;
$count += $text_str =~
s/\[\[($re_str)\]\]([[:alpha:]]*)/'''$1$2'''/igs;
$count += $text_str =~
s/\[\[$re_str\|(.+?)\]\]([[:alpha:]]*)/'''$1$2'''/igs;
$count or return ('Nincs onhivatkozas');
my $summary_str = $latin2->decode(
"Bot: $count önmagára mutató link kiiktatva. (Hibakód: $error_code)"
);
return ($summary_str, $count, $text_str);
}