From 951c1280abd2ad8f83d98fa4cb67c0475d2092c4 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 21 Jan 2018 20:07:33 -0800 Subject: [PATCH] Factoids: Do not increment depth for skipped expansions --- PBot/Factoids.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index c8ddd509..913be53a 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -412,12 +412,12 @@ sub expand_factoid_vars { $action =~ s/\$0/$root_keyword/g; my $const_action = $action; while ($const_action =~ /(\ba\s*|\ban\s*)?(?= 100; my ($a, $v) = ($1, $2); $v =~ s/(.):$/$1/; next if $v =~ m/^[\W_]/; # special character prefix skipped for shell/code-factoids/etc next if $v =~ m/^(nick|channel|randomnick|arglen|args|arg\[.+\]|[_0])$/i; # don't override special variables next if @exclude && grep { $v =~ m/^\Q$_\E$/i } @exclude; + last if ++$depth >= 100; $matches++;