--- bot_seen.module.orig	2007-04-17 11:35:56.000000000 +1200
+++ bot_seen.module	2007-04-17 11:30:28.000000000 +1200
@@ -33,8 +33,8 @@
   $nicks = array(); // list of nicks to search for.
 
   // log the message, whatever it is. no UPDATEs; just start anew, eh?
-  db_query('DELETE FROM {bot_seen} WHERE LOWER(nick) = "%s"', drupal_strtolower($data->nick));
-  db_query('INSERT INTO {bot_seen} (nick, channel, message, timestamp) VALUES ("%s", "%s", "%s", %d)', $data->nick, $data->channel, $data->message, time());
+  db_query("DELETE FROM {bot_seen} WHERE LOWER(nick) = '%s'", drupal_strtolower($data->nick));
+  db_query("INSERT INTO {bot_seen} (nick, channel, message, timestamp) VALUES ('%s', '%s', '%s', %d)", $data->nick, $data->channel, $data->message, time());
 
   // Match 'seen foo' in any mode, regardless if the bot was addressed.
   if (preg_match("/^seen ([a-zA-Z0-9\[\]\{\}\\\|\^\`\-\_\*]*)( ?\?|$)/", $data->message, $matches)) {
@@ -56,7 +56,7 @@
   foreach (array_unique($nicks) as $nick) {
     // allow % SQL matching, but only if the nick is three non-* characters or longer.
     if (strlen(str_replace('*', '', $nick)) >= 3) { $nick = str_replace('*', '%', $nick); }
-    $results = db_query('SELECT nick, channel, message, timestamp FROM {bot_seen} WHERE LOWER(nick) LIKE "%s" ORDER BY timestamp DESC', drupal_strtolower($nick));
+    $results = db_query("SELECT nick, channel, message, timestamp FROM {bot_seen} WHERE LOWER(nick) LIKE '%s' ORDER BY timestamp DESC", drupal_strtolower($nick));
     while ($result = db_fetch_object($results)) { // throw 'em on the bar-b... we'll shrink the result set later. to keep it relevant, we order by timestamp.
       $messages[] = isset($result->nick) // if we found a nick, great. otherwise, throw your hands up in an "i dunno" pose and move on to the next one.
         ? t("!nick was last seen in !channel !this_long ago saying '!message'.", array('!nick' => $result->nick, '!this_long' => format_interval(time() - $result->timestamp), '!channel' => $result->channel, '!message' => $result->message, ))
