1 # Copyright 2005-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: filter.oc,v 1.3 2007-03-30 23:40:48 pajamian Exp $
10 CodeDef filter OrderCheck 1
11 CodeDef filter Description Passes filter unchanged
12 CodeDef filter Routine <<EOR
14 my ($ref, $name, $value, $code) = @_;
19 if($code =~ /(["']).+?\1$/) {
20 my @code = Text::ParseWords::shellwords($code);
21 $message = pop(@code);
22 $filter = join " ", @code;
25 ($filter, $message) = split /\s+/, $code, 2;
28 my $test = Vend::Interpolate::filter_value($filter, $value, $name);
30 $message ||= errmsg("%s caught by filter %s", $name, $filter);
31 return ( 0, $name, $message);
33 return (1, $name, '');