From a6241f27938f2c09470d43c9a151a334f9923222 Mon Sep 17 00:00:00 2001 From: timdufrane Date: Tue, 13 Aug 2013 21:35:10 -0400 Subject: Fix Incorrect Directory Replacement On some installs, the directory ends up being /usr/pbi/dansguardian-xxx/... This results in include lines not being written correctly and broken config files. DANSGUARDIAN_DIR should be present on every system. --- config/dansguardian/dansguardian.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc index 39282409..d4cd94bd 100755 --- a/config/dansguardian/dansguardian.inc +++ b/config/dansguardian/dansguardian.inc @@ -331,7 +331,7 @@ function sync_package_dansguardian($via_rpc="no",$install_process=false) { #includes preg_replace patterns $match[0]="/(.)$/"; - $match[1]="/\/usr.local/"; + $match[1]="/\/usr.local|".str_replace("/","\\/",DANSGUARDIAN_DIR)."/"; $match[2]="/,/"; $replace[0]="$1>\n"; $replace[1]="\n.Include<".DANSGUARDIAN_DIR; @@ -1416,4 +1416,4 @@ function dansguardian_do_xmlrpc_sync($sync_to_ip,$username,$password,$sync_type, } } -?> \ No newline at end of file +?> -- cgit v1.2.3 From af0cf104b57482d767d8dc3745a0cf9751e998f6 Mon Sep 17 00:00:00 2001 From: timdufrane Date: Fri, 16 Aug 2013 14:13:38 -0400 Subject: Contentscanners preg_replace This condition also applies to the contentscanner section, and there is no variable substitution going on. Does not affect installs that use /usr/local, and allows the correct behavior on installs in /usr/pbi/dansguardian/... or wherever else (as long as DANSGUARDIAN_DIR is the correct directory). --- config/dansguardian/dansguardian.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc index d4cd94bd..12c2af93 100755 --- a/config/dansguardian/dansguardian.inc +++ b/config/dansguardian/dansguardian.inc @@ -321,7 +321,7 @@ function sync_package_dansguardian($via_rpc="no",$install_process=false) { #contentscanners preg_replace patterns $match[0]="/(conf)/"; - $match[1]="/(\/usr.local)/"; + $match[1]="/\/usr.local|".str_replace("/","\\/",DANSGUARDIAN_DIR)."/"; $match[2]="/,/"; $replace[0]="$1'"; $replace[1]="contentscanner = '".DANSGUARDIAN_DIR; -- cgit v1.2.3