Skip to content

Commit dc749bc

Browse files
committedOct 21, 2024
Fix to correctly handle link to home in File Manager
1 parent e84cb2a commit dc749bc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎summary_domain.cgi

+8-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ if ((!$aliasdom && $d->{'dir'}) ||
168168
my $domhome = "<tt>$d->{'home'}</tt>";
169169
if (&domain_has_website($d) && $d->{'dir'} &&
170170
!$d->{'proxy_pass_mode'} && &foreign_available("filemin")) {
171-
my $phd = &public_html_dir($d);
171+
my $ophd;
172+
my $phd = $ophd = &public_html_dir($d);
173+
my $hd = $d->{'home'};
172174
my %faccess = &get_module_acl(undef, 'filemin');
173175
my @ap = split(/\s+/, $faccess{'allowed_paths'});
174176
if (@ap == 1) {
@@ -177,8 +179,12 @@ if ((!$aliasdom && $d->{'dir'}) ||
177179
$ap[0] = $d->{'home'};
178180
}
179181
$phd =~ s/^\Q$ap[0]\E//;
182+
$hd =~ s/^\Q$ap[0]\E//;
183+
$hd = '/' if (!$hd);
180184
}
181-
$domhome = "<a href=\"@{[&get_webprefix_safe()]}/filemin/index.cgi?path=@{[&urlize($phd)]}\">$domhome</a>";
185+
my $dompath = -d $ophd ? &urlize($phd) : &urlize($hd);
186+
$domhome = "<a href=\"@{[&get_webprefix_safe()]}/filemin/index".
187+
".cgi?path=$dompath\">$domhome</a>";
182188
}
183189
print &ui_table_row($text{'edit_home'}, $domhome, 3);
184190
}

0 commit comments

Comments
 (0)
Please sign in to comment.