3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 11:42:35 +01:00

Factoids: expand_factoid_vars(): special-case Perl's $a and $b, etc

This commit is contained in:
Pragmatic Software 2020-06-12 18:57:01 -07:00
parent 85d887ff5c
commit b3ca5e69cd

View File

@ -765,8 +765,8 @@ sub expand_factoid_vars {
$extract_method = 'regex';
}
if ($var =~ /^(?:_.*|nick|channel|randomnick|arglen|args|arg\[.+\])$/i) {
# skip identifiers with leading underscore and special variables
if ($var =~ /^(?:_.*|\d+|a|b|nick|channel|randomnick|arglen|args|arg\[.+\])$/i) {
# skip identifiers with leading underscores, etc
$result .= $extract_method eq 'bracket' ? '${' . $var . '}' : '$' . $var;
next;
}