diff options
author | Chris Buechler <cmb@pfsense.org> | 2015-06-02 19:30:38 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2015-06-02 19:33:23 -0500 |
commit | b532745a9a14263cc33079f348e874ffe08fa42f (patch) | |
tree | f5dff5ee53a6b34b11ed7345f51ac04c48fe41b2 /etc/inc | |
parent | 813d71c1a3100148b8dea3e8246a0c3126e82cc4 (diff) | |
download | pfsense-b532745a9a14263cc33079f348e874ffe08fa42f.zip pfsense-b532745a9a14263cc33079f348e874ffe08fa42f.tar.gz |
Don't call growl if the configured address isn't an IP or resolvable
hostname. Avoids 1 minute timeout delay in fsockopen in growl.class. Cuts
that down to about a 20 second timeout. Ticket #4739
Conflicts:
etc/inc/notices.inc
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/notices.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index b006740..1ea30c8 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -410,7 +410,7 @@ function notify_via_growl($message, $force=false) { $growl_name = $config['notifications']['growl']['name']; $growl_notification = $config['notifications']['growl']['notification_name']; - if (!empty($growl_ip)) { + if(!empty($growl_ip) && (is_ipaddr($growl_ip) || dns_get_record($growl_ip, DNS_A) || dns_get_record($growl_ip, DNS_AAAA))) { $growl = new Growl($growl_ip, $growl_password, $growl_name); $growl->notify("{$growl_notification}", gettext(sprintf("%s (%s) - Notification", $g['product_name'], $hostname)), "{$message}"); } |