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

[livejournal] r21481: LJSUP-11564: Placeholder viewed incorrec...

Committer: amyshkin
LJSUP-11564: Placeholder viewed incorrect if user insert only i size
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-03-21 07:57:04 UTC (rev 21480)
+++ trunk/cgi-bin/cleanhtml.pl	2012-03-21 07:58:54 UTC (rev 21481)
@@ -1162,7 +1162,7 @@
                             }
                         }
 
-                        if ( exists $hash->{width} && $hash->{width} && exists $hash->{height} && $hash->{height} ) {
+                        if ( exists $hash->{width} && $hash->{width} =~ /^\d+$/ && exists $hash->{height} && $hash->{height} =~ /^\d+$/ ) {
                             if ( $hash->{'width'} > 140 && $hash->{'height'} > 37 ) {
                                 $img_bad = 1;
                             }
@@ -1170,15 +1170,9 @@
                                 $img_bad = 0;
                             }
                         }
-                        elsif ( exists $hash->{width} && ! exists $hash->{height} ) {
-                            delete $hash->{width};
-                            $img_bad = 1;
-                        }
-                        elsif ( exists $hash->{height} && ! exists $hash->{width} ) {
-                            delete $hash->{height};
-                            $img_bad = 1;
-                        }
                         else {
+                            delete $hash->{width} if exists $hash->{width};
+                            delete $hash->{height} if exists $hash->{height};
                             $img_bad = 1;
                         }
 

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