Changeset 11
- Timestamp:
- 02/06/08 22:57:05 (5 years ago)
- Location:
- trunk/Phergie/Event/Handler
- Files:
-
- 1 added
- 2 modified
-
AdminCommand.php (modified) (1 diff)
-
DNSLookup.php (modified) (1 diff)
-
Karma.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Phergie/Event/Handler/AdminCommand.php
r8 r11 66 66 ); 67 67 // Replace * so that they match correctly in a regex 68 $this->_admins[] = str_replace('*', ($excluded === '' ? '.*' : '[^'.$excluded.'] '), $admin);68 $this->_admins[] = str_replace('*', ($excluded === '' ? '.*' : '[^'.$excluded.']*'), $admin); 69 69 } 70 70 } -
trunk/Phergie/Event/Handler/DNSLookup.php
r10 r11 10 10 public function onPrivmsg(Phergie_Event_Request $event) 11 11 { 12 // Check if we have [rev]dns IP-address and if the IP is valid 12 13 if (preg_match('#^(?:rev)?dns ((?:[0-9]{1,3}\.){3}[0-9]{1,3})$#i', $event->getArgument(1), $m) && ip2long($m[1]) !== false) { 13 14 $this->doPrivmsg($event->getArgument(0), $m[1].' resolved as '.gethostbyaddr(long2ip(ip2long($m[1])))); 14 } elseif (preg_match('#^(?:rev)?dns ((?:[a-z0-9]+\.)+[a-z]{2,6})$#i', $event->getArgument(1), $m)) { 15 } 16 // Check if we have [rev]dns host 17 elseif (preg_match('#^(?:rev)?dns ((?:[a-z0-9]+\.)+[a-z]{2,6})$#i', $event->getArgument(1), $m)) { 15 18 if(($ip = gethostbyname($m[1])) !== $m[1]) { 16 19 $this->doPrivmsg($event->getArgument(0), $m[1] .' resolved as '.$ip);