holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r23557: LJSV-2531: [Posting] Width attribute par...

Committer: akanashin
LJSV-2531: [Posting] Width attribute parsed incorrectly
U   trunk/cgi-bin/LJ/EmbedModule.pm
Modified: trunk/cgi-bin/LJ/EmbedModule.pm
===================================================================
--- trunk/cgi-bin/LJ/EmbedModule.pm	2013-01-17 12:03:15 UTC (rev 23556)
+++ trunk/cgi-bin/LJ/EmbedModule.pm	2013-01-17 13:43:02 UTC (rev 23557)
@@ -419,11 +419,11 @@
             if ($type eq "S") {
                 my ($elewidth, $eleheight);
                 if ($attr->{width}) {
-                    $elewidth = $attr->{width}+0;
+                    $elewidth = $attr->{width} =~ m/^\d+%$/ ? $attr->{width} : $attr->{width}+0;
                     $width = $elewidth if $elewidth > $width;
                 }
                 if ($attr->{height}) {
-                    $eleheight = $attr->{height}+0;
+                    $eleheight = $attr->{height} =~ m/^\d+%$/ ? $attr->{height} : $attr->{height}+0;
                     $height = $eleheight if $eleheight > $height;
                 }
                 if ($attr->{style}) {

Tags: akanashin, holyandrew, livejournal, pm
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