eldy / AWStats

AWStats Log Analyzer project (official sources)
https://www.awstats.org
361 stars 119 forks source link

using HTML break syntax in XHTML #213

Closed sydb closed 2 years ago

sydb commented 2 years ago

In wwwroot/cgi-bin/awstats.pl circa line 1316 newlines are converted to <br> elements. But the syntax of both the Perl substitution operator replacement string and the string it produces are incorrect.

$messagestring =~ s/\n/\<br\>/g;

First, the backslashes in the replacement string are not needed. Second, this produces a <br> element using the HTML syntax, namely <br>. If one is generating XHTML output this fails pretty spectacularly. (The correct syntax in XHTML is <br/>, but any amount of whitespace is permitted between the GI (“br”) and the “/>”, and there are some browsers that barf if the amount of whitespace is none, so most people use <br />, as indeed this routine does elsewhere.)

I expect to submit a PR for this in the next few minutes.

sydb commented 2 years ago

PR #214 created.