Skip to content

Commit

Permalink
Avahi PHP 8.1 changes. Fixes #13752
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-p committed Dec 19, 2022
1 parent 9fe472d commit 1c8ad5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion net/pfSense-pkg-Avahi/Makefile
Expand Up @@ -2,7 +2,7 @@

PORTNAME= pfSense-pkg-Avahi
PORTVERSION= 2.2
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
7 changes: 3 additions & 4 deletions net/pfSense-pkg-Avahi/files/usr/local/pkg/avahi/avahi.inc
Expand Up @@ -115,7 +115,7 @@ function avahi_sync_config() {
stop_service('avahi');
}

$avahi_config = &$config['installedpackages']['avahi']['config'][0];
$avahi_config = config_get_path('installedpackages/avahi/config/0', []);
if (isset($avahi_config['enable'])) {
$enable = $avahi_config['enable'];
} else {
Expand Down Expand Up @@ -193,9 +193,8 @@ function avahi_get_carp_list() {
function avahi_plugin_carp($pluginparams) {
global $config;
/* If avahi is not configured, then stop */
if (is_array($config['installedpackages']['avahi']['config'])) {
$avahi_config = &$config['installedpackages']['avahi']['config'][0];
} else {
$avahi_config = config_get_path('installedpackages/avahi/config/0', []);
if (empty($avahi_config)) {
return null;
}
/* If there is no properly configured CARP status check IP, then stop */
Expand Down
9 changes: 3 additions & 6 deletions net/pfSense-pkg-Avahi/files/usr/local/www/avahi_settings.php
Expand Up @@ -25,17 +25,14 @@

$shortcut_section = 'avahi';

if (!is_array($config['installedpackages']['avahi']['config'])) {
$config['installedpackages']['avahi']['config'] = array();
}
$a_avahi = &$config['installedpackages']['avahi']['config'][0];
$a_avahi = config_get_path('installedpackages/avahi/config/0', []);

$actions = array(
"allow" => gettext("Allow Interfaces"),
"deny" => gettext("Deny Interfaces"),
);

if (isset($a_avahi)) {
if (!empty($a_avahi)) {
if (isset($a_avahi['interfaces'])) {
$pconfig = $a_avahi;
} elseif (isset($a_avahi['denyinterfaces'])) {
Expand Down Expand Up @@ -138,7 +135,7 @@

$avahi['filtering'] = $filtering;

$a_avahi = $avahi;
config_set_path('installedpackages/avahi/config/0', $avahi);
write_config("Updated Avahi settings");

avahi_sync_config();
Expand Down

0 comments on commit 1c8ad5a

Please sign in to comment.