]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only attempt callback if non-null
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 4 Aug 2010 15:46:04 +0000 (08:46 -0700)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 4 Aug 2010 15:46:04 +0000 (08:46 -0700)
plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php

index bd179719768b14aaaec26e8d066f32dd8886f13d..694fefc06b0df27449d5ab659e71ea884323d7fa 100644 (file)
@@ -84,15 +84,17 @@ class Phergie_Plugin_Statusnet extends Phergie_Plugin_Abstract {
      * @return void\r
      */\r
     public function onNotice() {\r
-        $event = $this->getEvent();\r
-        if ($event->getNick() == 'NickServ') {\r
-            $message = $event->getArgument(1);\r
-            if (preg_match($this->unregRegexp, $message, $groups)) {\r
-                $screenname = $groups[1];\r
-                call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => false));\r
-            } elseif (preg_match($this->regRegexp, $message, $groups)) {\r
-                $screenname = $groups[1];\r
-                call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => true));\r
+        if ($this->regCallback !== NULL) {\r
+            $event = $this->getEvent();\r
+            if ($event->getNick() == 'NickServ') {\r
+                $message = $event->getArgument(1);\r
+                if (preg_match($this->unregRegexp, $message, $groups)) {\r
+                    $screenname = $groups[1];\r
+                    call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => false));\r
+                } elseif (preg_match($this->regRegexp, $message, $groups)) {\r
+                    $screenname = $groups[1];\r
+                    call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => true));\r
+                }\r
             }\r
         }\r
     }\r