[Codestriker-commits] CVS update: codestriker/lib/Codestriker/Http HighlightLineFilter.pm
Brought to you by:
sits
From: <si...@us...> - 2008-06-18 06:44:35
|
User: sits Date: 08/06/17 23:44:34 Modified: lib/Codestriker/Http HighlightLineFilter.pm Log: Handle situation where the file is not recognised by the highlight program. In this situation, fallback to basic html encoding. Index: HighlightLineFilter.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/HighlightLineFilter.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HighlightLineFilter.pm 18 Jun 2008 04:47:13 -0000 1.3 +++ HighlightLineFilter.pm 18 Jun 2008 06:44:34 -0000 1.4 @@ -51,6 +51,11 @@ push @args, '-t'; push @args, $self->{tabwidth}; Codestriker::execute_command($read_stdout_fh, undef, $self->{highlight}, @args); + if ($read_data eq "") { + # Assume this occurred because the filename was an unsupported type. + # Just return the text appropriately encoded for html output. + $read_data = HTML::Entities::encode($text); + } # Delete the temp file. unlink $input_filename; |