[livejournal] r20766: LJSV-1557: Links in "Bio" section of pro...
Committer: sbelyaev
LJSV-1557: Links in "Bio" section of profile pages and in custom sidebar text get "nofollow" attr. even for Paid usersU trunk/cgi-bin/LJ/S2.pm U trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm 2011-12-12 14:35:41 UTC (rev 20765)
+++ trunk/cgi-bin/LJ/S2.pm 2011-12-12 15:53:56 UTC (rev 20766)
@@ -794,7 +794,7 @@
S2::set_output(sub {}); # printing suppressed
S2::set_output_safe(sub {});
eval { S2::run_code($ctx, "prop_init()"); };
- escape_all_props($ctx, \@layers);
+ escape_all_props($ctx, \@layers, $u);
return $ctx unless $@;
}
@@ -811,7 +811,7 @@
}
sub escape_all_props {
- my ($ctx, $lids) = @_;
+ my ($ctx, $lids, $u) = @_;
foreach my $lid (@$lids) {
foreach my $pname (S2::get_property_names($lid)) {
@@ -819,7 +819,7 @@
my $prop = S2::get_property($lid, $pname);
my $mode = $prop->{string_mode} || "plain";
- escape_prop_value($ctx->[S2::PROPS]{$pname}, $mode);
+ escape_prop_value($ctx->[S2::PROPS]{$pname}, $mode, $u);
}
}
}
@@ -832,6 +832,7 @@
sub escape_prop_value {
my $mode = $_[1];
my $css_c = _css_cleaner();
+ my $u = $_[2];
# This function modifies its first parameter in place.
@@ -847,11 +848,11 @@
}
elsif (! ref $_[0]) {
if ($mode eq 'simple-html' || $mode eq 'simple-html-oneline') {
- LJ::CleanHTML::clean_subject(\$_[0]);
+ LJ::CleanHTML::clean_subject(\$_[0], {posterid => $u->userid});
$_[0] =~ s!\n!<br />!g if $mode eq 'simple-html';
}
elsif ($mode eq 'html' || $mode eq 'html-oneline') {
- LJ::CleanHTML::clean_event(\$_[0]);
+ LJ::CleanHTML::clean_event(\$_[0], {posterid => $u->userid});
$_[0] =~ s!\n!<br />!g if $mode eq 'html';
}
elsif ($mode eq 'css') {
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl 2011-12-12 14:35:41 UTC (rev 20765)
+++ trunk/cgi-bin/cleanhtml.pl 2011-12-12 15:53:56 UTC (rev 20766)
@@ -1815,6 +1815,7 @@
'wordlength' => $wordlength,
'addbreaks' => $opts->{'preformatted'} ? 0 : 1,
'cutpreview' => $opts->{'cutpreview'},
+ 'posterid' => $opts->{'posterid'},
'eat' => $event_eat,
'mode' => 'allow',
'remove' => $event_remove,
