[interchange] * Allow a dash in the middle of a varname (and to end one)
Mike Heins <[email protected]> Fri, 27 May 2016 15:38:32 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit a3fe0eabb396640bcc57859898a33fce147d34c2 Author: Mike Heins <[email protected]> Date: Fri May 27 15:36:09 2016 +0000 * Allow a dash in the middle of a varname (and to end one) * Allow changable varname regex for profile checks via Limit profile_check_varname_regex \b\w[-+.\w]* lib/Vend/Order.pm | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) --- diff --git a/lib/Vend/Order.pm b/lib/Vend/Order.pm index 4ff8a6f..14c7b31 100644 --- a/lib/Vend/Order.pm +++ b/lib/Vend/Order.pm @@ -857,11 +857,14 @@ sub do_check { my $conditional_update; my $parameter = $_; + + my $varex = $::Limit->{profile_check_varname_regex} || '\w[-\w]*'; + my($var, $val, $m, $message); if (/^&/) { ($var,$val) = split /[\s=]+/, $parameter, 2; } - elsif ($parameter =~ /(\w+)[\s=]+(.*)/) { + elsif ($parameter =~ /($varex)[\s=]+(.*)/) { my $k = $1; my $v = $2; $conditional_update = $Update;