Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r18599: LJSUP-8218: cleanhtml improvements

Committer: gariev
LJSUP-8218: cleanhtml improvements

U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2011-03-17 07:07:15 UTC (rev 18598)
+++ trunk/cgi-bin/cleanhtml.pl	2011-03-17 07:31:48 UTC (rev 18599)
@@ -753,6 +753,12 @@
                         delete $hash->{$attr} unless $tag eq "object";
                         next;
                     }
+                    
+                    if ($attr eq 'width' || $attr eq 'height' ) {
+                        if ($hash->{$attr} > 1024*2) {
+                            $hash->{$attr} = 1024*2;
+                        }
+                    }
 
                     ## warning: in commets left by anonymous users, <img src="something">
                     ## is replaced by <a href="something"> (see 'extractimages' param)
@@ -1519,7 +1525,7 @@
     return "$LJ::SITEROOT/$uri";
 }
 
-my $subject_eat = [qw[head title style layer iframe applet object param]];
+my $subject_eat = [qw[head title style layer iframe applet object param base]];
 my $subject_allow = [qw[a b i u em strong cite]];
 my $subject_remove = [qw[bgsound embed object caption link font noscript lj-userpic]];
 sub clean_subject
@@ -1569,7 +1575,7 @@
     $$ref = LJ::text_trim($$ref, 0, $length);
 }
 
-my $event_eat = [qw[head title style layer applet object xml param]];
+my $event_eat = [qw[head title style layer applet object xml param base]];
 my $event_remove = [qw[bgsound embed object link body meta noscript plaintext noframes]];
 
 my @comment_close = qw(

Tags: gariev, livejournal, pl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments