madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r19973: LJSV-1286: Changed add_user_to_embed arg...

Committer: sbelyaev
LJSV-1286: Changed add_user_to_embed argument
U   trunk/cgi-bin/LJ/EmbedModule.pm
U   trunk/cgi-bin/cleanhtml.pl
U   trunk/htdocs/update.bml
Modified: trunk/cgi-bin/LJ/EmbedModule.pm
===================================================================
--- trunk/cgi-bin/LJ/EmbedModule.pm	2011-09-06 09:35:42 UTC (rev 19972)
+++ trunk/cgi-bin/LJ/EmbedModule.pm	2011-09-06 09:48:07 UTC (rev 19973)
@@ -159,12 +159,10 @@
 };
 
 sub add_user_to_embed {
-    my ($class, $u, $postref) = @_;
+    my ($class, $user_name, $postref) = @_;
 
     return unless $postref && $$postref;
-
-    my $journal = $u->user;
-    $$postref =~ s/(<\s*lj\-embed\s+id=)/<lj\-embed source_user="$journal" id=/g;
+    $$postref =~ s/(<\s*lj\-embed\s+id=)/<lj\-embed source_user="$user_name" id=/g;
 }
 
 # take a scalarref to a post, parses any lj-embed tags, saves the contents

Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2011-09-06 09:35:42 UTC (rev 19972)
+++ trunk/cgi-bin/cleanhtml.pl	2011-09-06 09:48:07 UTC (rev 19973)
@@ -1294,10 +1294,7 @@
                                             ? $entry->poster->username
                                             : '';
 
-                    my $journalu = LJ::want_user($poster_username);
-                    if ($journalu) {
-                        LJ::EmbedModule->add_user_to_embed($journalu, \$captured);
-                    }
+                    LJ::EmbedModule->add_user_to_embed($poster_username, \$captured);
                     $captured = LJ::Lang::ml("repost.wrapper", {
                                                 username => $poster_username,
                                                 url      => $entry->url,

Modified: trunk/htdocs/update.bml
===================================================================
--- trunk/htdocs/update.bml	2011-09-06 09:35:42 UTC (rev 19972)
+++ trunk/htdocs/update.bml	2011-09-06 09:48:07 UTC (rev 19973)
@@ -183,8 +183,7 @@
             $subject ||= (LJ::ehtml($entry->subject_orig) || LJ::Lang::ml("repost.default_subject"));
             unless ($event) {
                 $event = $entry->event_raw;
-                my $journalu = $entry->journal;
-                LJ::EmbedModule->add_user_to_embed($journalu, \$event);
+                LJ::EmbedModule->add_user_to_embed($entry->poster->username, \$event);
 
                 $event = LJ::Lang::ml("repost.wrapper", {
                                             username => $entry->poster->username,

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