r=justdave
Co-authored-by: Frédéric Buclin <LpSolit@gmail.com>
my $products = $params->{products} || [];
my $limit = $params->{limit} || MAX_POSSIBLE_DUPLICATES;
$limit = MAX_POSSIBLE_DUPLICATES if $limit > MAX_POSSIBLE_DUPLICATES;
- $products = [$products] if !ref($products) eq 'ARRAY';
+ $products = [$products] if ref($products) ne 'ARRAY';
my $orig_limit = $limit;
detaint_natural($limit)
$template ||= $context->stash->{component}->{name};
# sanity check:
- if (!$template =~ /[\w\.\/\-_\\]+/) {
+ if ($template !~ /[\w\.\/\-_\\]+/) {
ThrowCodeError('template_invalid', {name => $template});
}