From a8f0bc1f76471f5e46c2f592a7dc26ba1dc5e7dc Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Thu, 22 Jul 2010 18:50:31 -0400 Subject: [PATCH] adding check for /\?$/ in factoids --- plugins/factoids.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/factoids.pm b/plugins/factoids.pm index 257e594..aab85d0 100644 --- a/plugins/factoids.pm +++ b/plugins/factoids.pm @@ -608,6 +608,13 @@ sub basic_get_fact { } } else { + if ($subject =~ /\?$/) #check if some asshole decided to add a ? at the end of the factoid, if so remove it and recurse, this should only be able to recurse N times so it should be fine + { + my $newsubject = $subject; + $newsubject =~ s/\?$//; + return $self->basic_get_fact($pm, $said, $newsubject, $name, $call_only); + } + my $soundex = soundex( _clean_subject($subject, 1) ); my $matches = $self->_soundex_matches( $soundex );