Invalid XHTML character entity

Developers
2005-07-11
2012-10-11
  • If the output format is XHTML, awstats replaces " by &aquot; and ' by ' However, &aquot; not a valid HTML or XHTML entity. Moreover ' is a new entity defined by XHTML but is not valid in HTML documents.

    The following patch corrects these problems

    --- awstats.pl.orig 2005-07-11 21:21:55.000000000 +0200
    +++ awstats.pl 2005-07-11 21:23:27.000000000 +0200
    @@ -4234,8 +4234,8 @@
    $string =~ s/&/&/g;
    $string =~ s/</&lt;/g;
    $string =~ s/>/&gt;/g;
    - $string =~ s/\&quot;/&aquot;/g;
    - $string =~ s/\'/&apos;/g;
    + $string =~ s/\&quot;/&quot;/g;
    + $string =~ s/\'/&#39;/g;
    return $string;
    }

    @@ -4251,8 +4251,8 @@
    $string =~ s/&/&amp;/g;
    $string =~ s/</&lt;/g;
    $string =~ s/>/&gt;/g;
    - $string =~ s/\&quot;/&aquot;/g;
    - $string =~ s/\'/&apos;/g;
    + $string =~ s/\&quot;/&quot;/g;
    + $string =~ s/\'/&#39;/g;
    return $string;
    }