From a6e865c47ad923f2c4cf97b1966f9eb9baad4553 Mon Sep 17 00:00:00 2001 From: Luke Fitzgerald Date: Thu, 5 Aug 2010 11:12:36 -0700 Subject: [PATCH] Use nick length instead --- plugins/Irc/IrcPlugin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/Irc/IrcPlugin.php b/plugins/Irc/IrcPlugin.php index 5b5cab2ec5..8fda359452 100644 --- a/plugins/Irc/IrcPlugin.php +++ b/plugins/Irc/IrcPlugin.php @@ -182,8 +182,9 @@ class IrcPlugin extends ImPlugin { if (strpos($data['source'], '#') === 0) { $message = $data['message']; $nickpos = strpos($message, $this->nick); - $colonpos = strpos($message, ':', $nickpos); - if ($nickpos === 0 && $colonpos == strlen($this->nick)) { + $nicklen = strlen($this->nick); + $colonpos = strpos($message, ':', $nicklen); + if ($nickpos === 0 && $colonpos == $nicklen) { $this->handle_incoming($data['sender'], substr($message, $colonpos+1)); } } else { -- 2.39.5