[ic] Apexes, inverted commas problem
mike at perusion.com
Mon Nov 24 13:30:30 EST 2003
Quoting Marco Mescoli (m.mescoli at omnibit.nu):
> Old and same problem: apexes inside a cgi parameter that give error in an
> insert SQL query.
> Is there a IC tag that insert a slash '\' before apexes in a string ?
> An other idea to solve this ?
If I knew what an apex was, I could tell you. 8-) I don't know of any
character that causes a problem except a single-quote, so I will
assume that is what you mean.
[cgi name=yourparam filter=sql keep=1]
Remove the keep=1 if you want the value to be permanently changed
to the filtered version.
By the way, backslash does not escape for most SQL implementations;
you double the single-quote (apex?) character.
> I dig mailing list archive without results.
Hmm. You must not have searched on "filter".
You can add filters to IC to filter anything -- there should
be many examples of how to make one.
CodeDef remove_apex Filter
CodeDef remove_apex Routine <<EOR
my $value = shift;
my $apex = "?";
$value =~ s/$apex/\\$apex/g;
If that goes in catalog.cfg, then
[cgi name=yourparam filter=remove_apex keep=1]
will provide the filtered value. This is a faster version
[filter op=remove_apex interpolate=1][cgi yourparam][/filter]
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.765.647.1295 <mike at perusion.com>
If you like what you're gettin', keep doin' what you're doin'. -- Hector
More information about the interchange-users