Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r21216: LJSUP-10691: Image placeholders in comme...

Committer: amyshkin
LJSUP-10691: Image placeholders in comments
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-02-17 14:21:35 UTC (rev 21215)
+++ trunk/cgi-bin/cleanhtml.pl	2012-02-20 06:59:07 UTC (rev 21216)
@@ -358,6 +358,7 @@
                 if ( $tag eq 'a' ) {
                     $in_link = 1;
                     $href_b_link = $attr->{href};
+                    $text_a_link = 0;
                 }
 
                 if ( $tag eq 'img' && $in_link ) {
@@ -374,6 +375,7 @@
                     # can pass in tokens to override passing the hook the @capture array
                     my ($token, $override_capture) = @_;
                     my $capture = $override_capture ? [$token] : \@capture;
+
                     # In $expanded we must has valid unicode string.
                     my $expanded = ($name =~ /^\w+$/) ?
                         Encode::decode_utf8(LJ::run_hook("expand_template_$name", $capture)) : "";
@@ -1346,6 +1348,7 @@
                     $href_b_link = '';
                     $img_link    = 0;
                 }
+                next TOKEN if $text_a_link;
             }
 
             my $allow;

Tags: amyshkin, livejournal, pl, zilogic
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