X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Froutetextstring;h=4202ce9a4881b69c2343ca00400f52105d926d2b;hb=9ad85b94399ad653e1d10fd18500a9e2205f032d;hp=b84fd8447708e70b4b463ab10fdf2719545cc1d0;hpb=7031695ce7767c196f2ef0f279bf4e3c7931c211;p=ypp-sc-tools.web-live.git diff --git a/yarrg/web/routetextstring b/yarrg/web/routetextstring index b84fd84..4202ce9 100644 --- a/yarrg/web/routetextstring +++ b/yarrg/web/routetextstring @@ -29,7 +29,8 @@ if ($format =~ 'json') { $r->content_type($ctype or $format); $output= sub { print to_json({ success => 1, - show => encode_entities($canontext), + show => length $canontext ? encode_entities($canontext) + : ' ', })}; $output_wrong= sub { print to_json({ success => 0, @@ -60,7 +61,7 @@ foreach my $each (split m#[/|,]#, $string) { push @results, $results->[0]; } -$canontext= join ' | ', map { encode_entities($_->[2]) } @results; +$canontext= join ' | ', map { $_->[2] } @results; $output->();