Perlbal - [patch] Fix dirindexing subdirectory links in ClientHTTPBase.pm

This is Interesting: Free IT Magazines  
Home > Archive > Perlbal > December 2005 > [patch] Fix dirindexing subdirectory links in ClientHTTPBase.pm





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [patch] Fix dirindexing subdirectory links in ClientHTTPBase.pm
Fred Moyer

2005-12-10, 8:45 pm

Hello,

I noticed that for dirindexing = 1 option Perlbal was not generating the
correct hrefs for subdirectories. The following patch fixes that issue.

- Fred

--- ClientHTTPBase.pm 2005-12-10 16:20:24.000000000 -0800
+++ ClientHTTPBase.pm 2005-12-10 16:27:21.000000000 -0800
@@ -450,9 +450,9 @@
opendir(D, $file);
foreach my $de (sort readdir(D)) {
if (-d "$file/$de") {
- $body .= "<b><a href='$de/'>$de</a></b><br />\n";
+ $body .= "<b><a href='$uri$de/'>$de</a></b><br />\n";
} else {
- $body .= "<a href='$de'>$de</a><br />\n";
+ $body .= "<a href='$uri$de'>$de</a><br />\n";
}
}
closedir(D);

Mark Smith

2005-12-13, 5:45 pm

Fred,

Thanks for noting this. I've committed the patch with some other little
things that just generally clean this code up:

http://www.livejournal.com/communit...og/2496237.html

Thanks again!


On Sat, Dec 10, 2005, Fred Moyer wrote:
> Hello,
>
> I noticed that for dirindexing = 1 option Perlbal was not generating the
> correct hrefs for subdirectories. The following patch fixes that issue.
>
> - Fred
>
> --- ClientHTTPBase.pm 2005-12-10 16:20:24.000000000 -0800
> +++ ClientHTTPBase.pm 2005-12-10 16:27:21.000000000 -0800
> @@ -450,9 +450,9 @@
> opendir(D, $file);
> foreach my $de (sort readdir(D)) {
> if (-d "$file/$de") {
> - $body .= "<b><a href='$de/'>$de</a></b><br />\n";
> + $body .= "<b><a href='$uri$de/'>$de</a></b><br />\n";
> } else {
> - $body .= "<a href='$de'>$de</a><br />\n";
> + $body .= "<a href='$uri$de'>$de</a><br />\n";
> }
> }
> closedir(D);



--
Junior (aka Mark Smith)
junior@danga.com

Software Engineer
Six Apart / Danga Interactive

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com