[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#670816: marked as done (Sanatizer breaks html message if STYLE contains comment markers.)



Your message dated Tue, 28 Feb 2023 15:10:36 +0000
with message-id <[🔎] E1pX1ci-00AZEg-8E@fasolo.debian.org>
and subject line Bug#1016190: Removed package(s) from unstable
has caused the Debian Bug report #670816,
regarding Sanatizer breaks html message if STYLE contains comment markers.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
670816: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670816
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---

Package: sanitizer

Version: 1.76-3

 

If a <style> block politely contains  <!-- and --> comment markers to hide the style sheet on old browsers the sanitizer code to hide the style sheet for impolite mail generators breaks the message.

 

It leaves the opening style tag incomplete in the form "<style_01 " with the comment marker following after.

 

This patch adds a trailing ‘>’ to the style tag to close it so the produced HTML isn’t severely broken in this case.

 

Robert de Bath

 

 

--- HTMLCleaner.pm      2012-04-29 10:08:09.000000000 +0100

+++ /usr/share/perl5/Anomy/HTMLCleaner.pm       2012-04-29 10:09:47.000000000 +0100

@@ -791,7 +791,7 @@

        my $data = "">

        my $cnt = $self->{style_index}++;

        $self->{styles}->[$cnt] = $data;

-       return "<style_$cnt ";

+       return "<style_$cnt> ";

}

 

# This routine sanitizes a snippet of HTML.

@@ -827,8 +827,8 @@

     {

         $self->{"style_count"} += ($$data_ptr =~ s/<(style[^<>]*)>/ $self->record_style($1) /geis);

     }

-    $self->{"style_count"} -= ($$data_ptr =~ s/<style_(\d+)( [^<>]+)(<\/style>)/<$self->{styles}->[$1]$2>$3/gis);

-    $self->{"style_count"} -= ($$data_ptr =~ s/<style_(\d+) ([^<>]+)</<$self->{styles}->[$1]>$2</gis);

+    $self->{"style_count"} -= ($$data_ptr =~ s/<style_(\d+)>( [^<>]+)(<\/style>)/<$self->{styles}->[$1]$2>$3/gis);

+    $self->{"style_count"} -= ($$data_ptr =~ s/<style_(\d+)> ([^<>]+)</<$self->{styles}->[$1]>$2</gis);

 

     # Check for trailing tags...

     if ($$data_ptr =~ s/(<(?:!--\s+)?[A-Za-z]+[^>]+)$//s)

@@ -838,7 +838,7 @@

         {

                if (($self->{"style_count"} > 0) &&

                    # Fix this long evil tag we artificially spawned above...

-                   (my $n = ($leftovers =~ s/<style_(\d+) ([^>]*)$/<$self->{styles}->[$1]>$2/is)))

+                   (my $n = ($leftovers =~ s/<style_(\d+)> ([^>]*)$/<$self->{styles}->[$1]>$2/is)))

                {

                    $self->{"style_count"} -= $n;

                }


--- End Message ---
--- Begin Message ---
Version: 1.76-5.1+rm

Dear submitter,

as the package sanitizer has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1016190

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: