diff options
Diffstat (limited to 'etc/inc/growl.class')
-rw-r--r-- | etc/inc/growl.class | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/etc/inc/growl.class b/etc/inc/growl.class index aa35533..883ec8b 100644 --- a/etc/inc/growl.class +++ b/etc/inc/growl.class @@ -77,20 +77,26 @@ { if(function_exists('socket_create') && function_exists('socket_sendto')) { - $sck = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); - socket_sendto($sck, $data, strlen($data), 0x100, $this->address, $this->port); - return true; + $sck = @socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + if ($sck) { + socket_sendto($sck, $data, strlen($data), 0x100, $this->address, $this->port); + return true; + } } elseif(function_exists('fsockopen')) { - $fp = fsockopen('udp://' . $this->address, $this->port); - fwrite($fp, $data); - fclose($fp); - return true; + if ($this->address) { + $fp = @fsockopen('udp://' . $this->address, $this->port); + if ($fp) { + fwrite($fp, $data); + fclose($fp); + return true; + } + } } return false; } } -?>
\ No newline at end of file +?> |