diff options
author | Luke Fitzgerald <lw.fitzgerald@googlemail.com> | 2010-08-04 08:46:04 -0700 |
---|---|---|
committer | Luke Fitzgerald <lw.fitzgerald@googlemail.com> | 2010-08-04 08:46:04 -0700 |
commit | 2250273942aadbdf8ec4603eb693259c359d1b79 (patch) | |
tree | 8b53799c489e585d8c6b058afca9e69448adce7d | |
parent | 4cfe04a68f094740cf22943c0375c33d374d5954 (diff) |
Only attempt callback if non-null
-rw-r--r-- | plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php index bd1797197..694fefc06 100644 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php @@ -84,15 +84,17 @@ class Phergie_Plugin_Statusnet extends Phergie_Plugin_Abstract { * @return void
*/
public function onNotice() {
- $event = $this->getEvent();
- if ($event->getNick() == 'NickServ') {
- $message = $event->getArgument(1);
- if (preg_match($this->unregRegexp, $message, $groups)) {
- $screenname = $groups[1];
- call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => false));
- } elseif (preg_match($this->regRegexp, $message, $groups)) {
- $screenname = $groups[1];
- call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => true));
+ if ($this->regCallback !== NULL) {
+ $event = $this->getEvent();
+ if ($event->getNick() == 'NickServ') {
+ $message = $event->getArgument(1);
+ if (preg_match($this->unregRegexp, $message, $groups)) {
+ $screenname = $groups[1];
+ call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => false));
+ } elseif (preg_match($this->regRegexp, $message, $groups)) {
+ $screenname = $groups[1];
+ call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => true));
+ }
}
}
}
|