wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[miscperl] r265: LJSV-1243. Allow users to embed media us...

Committer: wisest-owl
LJSV-1243. Allow users to embed media using iframes

U   trunk/HTMLCleaner.pm
Modified: trunk/HTMLCleaner.pm
===================================================================
--- trunk/HTMLCleaner.pm	2010-09-23 08:39:36 UTC (rev 264)
+++ trunk/HTMLCleaner.pm	2011-03-01 07:58:17 UTC (rev 265)
@@ -23,15 +23,18 @@
 
     $p->utf8_mode(1);
 
+    $p->{'eat_tag'} = { map { $_ => 1 }
+               qw(script object iframe applet embed param) };
+
+    ## Enabling tag 'iframe' if need
+    delete $p->{'eat_tag'}->{'iframe'} if $opts{'enable_iframe'};
+
     bless $p, $class;
 }
 
 my %bad_attr = (map { $_ => 1 }
                 qw(datasrc datafld));
 
-my %eat_tag = (map { $_ => 1 }
-               qw(script iframe object applet embed param));
-
 my @eating;  # push tagname whenever we start eating a tag
 
 sub start {
@@ -47,7 +50,7 @@
     my @allowed_tags = ('lj-embed');
 
     push @eating, $tagname if
-        $eat_tag{$tagname} && ! grep { lc $tagname eq $_ } @allowed_tags;
+        $self->{'eat_tag'}->{$tagname} && ! grep { lc $tagname eq $_ } @allowed_tags;
 
     return if @eating;
 

Tags: miscperl, pm, wisest-owl
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