Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 57539
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: DAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.22
Fixed in: (no value)



Subject: incorrect regexes /^foo|bar$/ instead of /^(foo|bar)$/
several places in the source code incorrectly check for regexes of shape /^foo|bar$/ instead of /^(foo|bar)$/. The former works, but there is a risk of matching other strings than just "foo" and "bar", like "footage" or "carambar". ack --nocolor --nogroup --nofilter -- "/\^\w+\|" Context.pm:750: if ($args[0] =~ /^on|1$/i) { Context.pm:754: elsif ($args[0] =~ /^off|0$/i) { Directive.pm:653: die \$_tt_error if \$_tt_error->type =~ /^return|stop\$/; Stash.pm:78: if ($type =~ /^scalar|item$/) { Stash.pm:84: elsif ($type =~ /^list|array$/) {
Ticket migrated to github as https://github.com/abw/Template2/issues/94