--- loncom/interface/spellcheck.pm 2012/08/27 11:09:56 1.2 +++ loncom/interface/spellcheck.pm 2012/09/10 09:51:06 1.4 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: spellcheck.pm,v 1.2 2012/08/27 11:09:56 foxr Exp $ +# $Id: spellcheck.pm,v 1.4 2012/09/10 09:51:06 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -76,7 +76,7 @@ sub spell_check { # Turn the words into an array: - my @word_list = split(/\s+/, $words); + my @word_list = split(/\+/, $words); my @mis_spelled; foreach my $word (@word_list) { @@ -124,6 +124,8 @@ sub handler { } else { $raw_params = $r->args(); } + + my $query = CGI->new($raw_params); # Figure out the language defaulting to english. @@ -148,7 +150,7 @@ sub handler { } elsif ($query->param('suggest')) { $data = &suggest_spellings($query->param('suggest'), $language); } else { - die "Invalid request"; + $data = "[]"; # We seem to get this from time to time. } $r->print($data);