X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fqtextstringcheck;h=bb3fc31730293b44d4124ed751379ddf4850f791;hb=f276a86ab559f7800713f94bcda826d6783f46ab;hp=9dce8287e208d8213418dd6432e49898c998a74a;hpb=c810347487961a59b3d8dfb2fed123f49dc22ed4;p=ypp-sc-tools.web-live.git diff --git a/yarrg/web/qtextstringcheck b/yarrg/web/qtextstringcheck index 9dce828..bb3fc31 100755 --- a/yarrg/web/qtextstringcheck +++ b/yarrg/web/qtextstringcheck @@ -33,7 +33,7 @@ text string parsers/checkers like check_routestring. # typical url for this script: -# http://www.chiark.greenend.org.uk/ucgi/~clareb/mason/pirates/qtextstring?what=routestring?format=json&ocean=Midnight&string=d +# http://www.chiark.greenend.org.uk/ucgi/~clareb/mason/pirates/qtextstring?what=routestring?format=json&ocean=Cerulean&string=d @@ -60,12 +60,13 @@ use Scalar::Util qw(blessed); die if $what =~ m/[^a-z]/; my $chk= $m->fetch_comp("check_${what}"); +die "check_$what" unless $chk; my $mydbh; $dbh ||= ($mydbh= dbw_connect($ocean)); my $debugf= !$debug ? sub { } : sub { - print "@_\n"; + print escapeHTML("@_")."\n"; }; $debugf->("QTSC STRING '$string'"); @@ -105,11 +106,12 @@ if ($chk->method_exists('execute')) { $sth, $sqlstmt_nqs, $chk->attr_exists('abbrev_initials'), $chk->attr('maxambig'), - $chk->scall_method("nomatch", spec => $each), + $chk->scall_method("nomatch", specq => escerrq($each)), $chk->scall_method("manyambig"), sub { $chk->scall_method("ambiguous", - spec => $each, couldbe => $_[1]) + specq => escerrq($each), + couldbe => $_[1]) }); if (defined $temsg) { $emsg= $temsg;