#4038 Login page has an incorrect title.

1.570
closed-fixed
nobody
None
5
2012-01-08
2012-01-08
Spike
No

Operating system Ubuntu Linux 11.04
Webmin version 1.570

While trying to get KeePass working with the Webmin login page, I discovered that the <title> tag is included twice on the login page. The first one is empty, which makes Firefox display the URL as the title. This complicates getting KeePass to work.

I've tracked the issue down to a section in web-lib-funcs.pl, starting at line 807.
my $title = &get_html_title($_[0]);
print "<title>$title</title>\n";
print $_[7] if ($_[7]);

Here it prints 2 titles (when parameter 7 is provided).
I am by no means a Perl programmer and I am not sure which title should take precedence, but I assume the fix is somewhere along the line of:
my $title = &get_html_title($_[0]);
if ($title eq "") {
print $_[7] if ($_[7]);
}
else {
print "<title>$title</title>\n";
}

I have not submitted the code change as I am just to inexperienced in both Perl and Webmin programming to be sure the fix is correct. I am confident however that this pointer should allow someone else to fix the issue.

Discussion

  • Jamie Cameron
    Jamie Cameron
    2012-01-08

    Thanks for pointing this out - I will fix it in the next Webmin release.

     
  • Jamie Cameron
    Jamie Cameron
    2012-01-08

    • status: open --> closed-fixed