X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Froutetextstring;fp=yarrg%2Fweb%2Froutetextstring;h=be009d4e5a4b8fa624a5f809a079a432d0b1da2f;hb=734c62d8185e721a576750ce5aa1182f04d1de9e;hp=9107780def29f20e6f28715178efe4397c9c6176;hpb=efc8497c2414dfded724d7181e11df53b947e387;p=ypp-sc-tools.db-live.git diff --git a/yarrg/web/routetextstring b/yarrg/web/routetextstring index 9107780..be009d4 100755 --- a/yarrg/web/routetextstring +++ b/yarrg/web/routetextstring @@ -69,12 +69,12 @@ my ($output, $output_wrong); if ($format =~ /json/) { $r->content_type($ctype or $format); - $output= sub { print to_json({ + $output= sub { print to_json_shim({ success => 1, show => length $canontext ? encode_entities($canontext) : ' ', })}; - $output_wrong= sub { print to_json({ + $output_wrong= sub { print to_json_shim({ success => 0, show => $_[0], })}; @@ -108,7 +108,7 @@ foreach my $each (split m#[/|,]#, $string) { if (!$results) { if (!%m) { return $err->('no island or arch matches "%s"'); - } elsif (%m > 5) { + } elsif (keys(%m) > 5) { return $err->(' '); } else { return $err->('ambiguous island or arch "%s",'.