Changeset 247
- Timestamp:
- 04/15/08 02:22:51 (7 months ago)
- Files:
-
- trunk/Phergie/Plugin/Autojoin.php (modified) (1 diff)
- trunk/Phergie/Plugin/Dns.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Autojoin.php
r243 r247 83 83 $channels = $this->getPluginIni('channels'); 84 84 if (!empty($channels)) { 85 $spec = explode(' ', $channels);85 $spec = split('/\s+/', preg_replace('/,\s+/', ',', trim($channels)), 2); 86 86 if (count($spec) > 1) { 87 87 $this->doJoin($spec[0], $spec[1]); trunk/Phergie/Plugin/Dns.php
r217 r247 16 16 protected function processRequest($arg) 17 17 { 18 $source = $this->event->getSource(); 18 19 $target = $this->event->getNick(); 20 19 21 if (preg_match('/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/', $arg)) { 20 22 $resolved = gethostbyaddr(long2ip(ip2long($arg))); … … 23 25 } 24 26 25 $source = $this->event->getSource();26 27 if (!isset($resolved)) { 27 28 $this->doPrivmsg($source, $target . ': ' . $arg . ' cannot be resolved.'); … … 52 53 $this->processRequest($ip); 53 54 } 55 56 /** 57 * Intercepts, processes, and responds with the result of prototype lookup 58 * requests. 59 * 60 * @param string $function Name of the function to look up 61 * @return void 62 */ 63 public function onDoHostIp($host) 64 { 65 $target = $this->event->getNick(); 66 67 $tmp = file_get_contents('http://api.hostip.info/get_html.php?position=true&ip=' . urlencode(trim($host))); 68 if (!empty($tmp) && stripos($tmp, 'Private Address') === false) { 69 $contents = $host . ' -> ' . preg_replace(array('/\s+/', '/[\r\n]+/'), array(' ', ' - '), trim($tmp)); 70 $this->doPrivmsg($this->event->getSource(), $target . ': ' . $contents); 71 } 72 unset($host, $tmp, $contents); 73 } 74 54 75 }