vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r19382: LJSUP-9168: entry failed to render.

Committer: vad
LJSUP-9168: entry failed to render.
U   trunk/cgi-bin/ljtextutil.pl
Modified: trunk/cgi-bin/ljtextutil.pl
===================================================================
--- trunk/cgi-bin/ljtextutil.pl	2011-06-28 06:30:50 UTC (rev 19381)
+++ trunk/cgi-bin/ljtextutil.pl	2011-06-28 06:31:35 UTC (rev 19382)
@@ -979,7 +979,7 @@
     my $p = HTML::TokeParser->new($htmlref);
 
     while (my $token = $p->get_token) {
-        if ($token->[1] eq "img") {
+        if ($token->[1] eq "img" and ref $token->[2] eq 'HASH') {
             my $attrs = $token->[2];
             foreach my $attr (keys %$attrs) {
                 push @image_urls, $attrs->{$attr} if
@@ -1001,7 +1001,7 @@
     my $p = HTML::TokeParser->new($htmlref);
 
     while (my $token = $p->get_token) {
-        if ($token->[0] eq "S" && $token->[1] eq "a") {
+        if ($token->[0] eq "S" && $token->[1] eq "a" and ref $token->[2] eq 'HASH') {
             my $attrs = $token->[2];
             foreach my $attr (keys %$attrs) {
                 push @link_urls, $attrs->{$attr} if $attr eq "href";

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