Committer: nnikulochkina
LJSUP-11578: XML RPC, ?\209?\132?\209?\131?\208?\189?\208?\186?U trunk/cgi-bin/ljtextutil.pl
Modified: trunk/cgi-bin/ljtextutil.pl =================================================================== --- trunk/cgi-bin/ljtextutil.pl 2012-06-28 18:58:46 UTC (rev 22347) +++ trunk/cgi-bin/ljtextutil.pl 2012-06-29 07:01:56 UTC (rev 22348) @@ -855,12 +855,14 @@ $args{event} =~ s#<lj\-embed[^>]+/>#<a href="$args{embed_url}">View movie.</a>#g; while ( $args{event} =~ /<lj\s+user="([^>"]+)"\s*\/?>/g ){ # follow the documentation - no about communites, openid or syndicated, just user - my $user = LJ::load_user($1); + my $username = $1; + my $user = LJ::load_user($username); + # $username may be not equal to $name (if $username is not canonical username) my $name = $user->username; my $html = '<a href="' . $user->profile_url . '" target="_blank"><img src="' . $LJ::IMGPREFIX . '/userinfo.gif?v=17080" alt=""></a><a href="' . $user->journal_base . '" target="_blank">' . $name . '</a>'; - $args{event} =~ s#<lj\s+user="$name"\s*\/?>#$html#g; + $args{event} =~ s#<lj\s+user="$username"\s*\/?>#$html#g; } $args{event} =~ s#</?lj-cut[^>]*>##g;