From aa14c77b169f1e748769f3bf5205669d8c620495 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 3 Feb 2024 21:50:18 +0200 Subject: [PATCH] Add to check if function exists too --- find.cgi | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/find.cgi b/find.cgi index b5d916d..645d33c 100755 --- a/find.cgi +++ b/find.cgi @@ -53,13 +53,15 @@ while(my $f = <$FIND>) { my $currfilename = $currfile; # Extract filename from path $currfilename =~ s/.*\///; foreach my $p (&virtual_server::list_feature_plugins()) { - my ($err, $status) = &virtual_server::plugin_call($p, - "feature_add_protected_dir", $d, - { 'protected_dir' => $dir, - 'protected_user_file_path' => $currfile, - 'protected_user_file' => $currfilename, - 'protected_name' => $text{'find_authreq'} }); - $f_extra = $text{"find_webservstatus$status"} if (defined($status)); + if (&virtual_server::plugin_defined($p, "feature_add_protected_dir")) { + my ($err, $status) = &virtual_server::plugin_call($p, + "feature_add_protected_dir", $d, + { 'protected_dir' => $dir, + 'protected_user_file_path' => $currfile, + 'protected_user_file' => $currfilename, + 'protected_name' => $text{'find_authreq'} }); + $f_extra = $text{"find_webservstatus$status"} if (defined($status)); + } } } print $f_indent.&text("find_found$f_label", "$f_name",