Henry Lyne (henrylyne) wrote in changelog,
Henry Lyne
henrylyne
changelog

[livejournal] r14801: LJSV-523: Stop converting & to an HTML e...

Committer: henrylyne
LJSV-523: Stop converting & to an HTML entity inside URL attributes of an lj-embed.
A more graceful suggestion for cleaning URL attributes is welcome.

U   trunk/cgi-bin/LJ/EmbedModule.pm
Modified: trunk/cgi-bin/LJ/EmbedModule.pm
===================================================================
--- trunk/cgi-bin/LJ/EmbedModule.pm	2009-01-23 17:57:50 UTC (rev 14800)
+++ trunk/cgi-bin/LJ/EmbedModule.pm	2009-01-23 19:25:36 UTC (rev 14801)
@@ -429,7 +429,14 @@
             # FIXME: ultra ghetto.
             $attr->{$name} = LJ::no_utf8_flag($attr->{$name});
 
-            $txt .= " $name=\"" . LJ::ehtml($attr->{$name}) . "\"";
+            my $tribute = " $name=\"" . LJ::ehtml($attr->{$name}) . "\"";
+
+            # FIXME: This fixes problems caused by using ehtml on URLs
+            # but not very gracefully. Find a better way to clean URLs
+            $tribute =~ s/\&/\&/g
+                if ($name =~ /movie|src/ && $attr->{$name} =~ /^http:\/\/.*/);
+
+            $txt .= $tribute;
         }
         $txt .= $selfclose ? " />" : ">";
 

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