If you hook site_html_add_link you can probably do something like this:
my @fields = qw/Title/;
my $chars = GT::Plugins->get_plugin_user_cfg('Your_Plugin')->{Filter};
my @bad = ();
foreach my $field (keys %$input) {
next unless grep $field, @fields;
if ($input->{$field} =~ /\Q$chars\E/) {
push @bad, "$field contains invalid characters!";
}
}
That's just a quick code sample that will probably need altering but it is just a quick idea for you. The plugin would have a user option called "Filter" which you'd then use to enter your blocked characters.
Code:
my $input = $IN->get_hash; my @fields = qw/Title/;
my $chars = GT::Plugins->get_plugin_user_cfg('Your_Plugin')->{Filter};
my @bad = ();
foreach my $field (keys %$input) {
next unless grep $field, @fields;
if ($input->{$field} =~ /\Q$chars\E/) {
push @bad, "$field contains invalid characters!";
}
}
That's just a quick code sample that will probably need altering but it is just a quick idea for you. The plugin would have a user option called "Filter" which you'd then use to enter your blocked characters.