Do not strip links from comments by trusted OpenID users. Also, warn
when comments are going to have links stripped.
Patch by denise.
diffs (77 lines):
diff -r 1da32e20a5ee -r 666dca7810f8 cgi-bin/LJ/S2/EntryPage.pm
--- a/cgi-bin/LJ/S2/EntryPage.pm Sat Feb 13 01:40:19 2010 +0000
+++ b/cgi-bin/LJ/S2/EntryPage.pm Sun Feb 14 03:39:46 2010 +0000
@@ -146,8 +146,9 @@ sub EntryPage
# quote all non-LJ tags
$text =~ s{<(?!/?lj)(.*?)>} {<$1>}gi;
}
+
LJ::CleanHTML::clean_comment(\$text, { 'preformatted' =>
$com->{'props'}->{'opt_preformatted'},
- 'anon_comment' => (!$pu ||
$pu->is_identity),
+ 'anon_comment' => !$pu || (
$pu->is_identity && !$u->trusts_or_has_member( $pu ) ),
});
# local time in mysql format to gmtime
diff -r 1da32e20a5ee -r 666dca7810f8 cgi-bin/LJ/S2/ReplyPage.pm
--- a/cgi-bin/LJ/S2/ReplyPage.pm Sat Feb 13 01:40:19 2010 +0000
+++ b/cgi-bin/LJ/S2/ReplyPage.pm Sun Feb 14 03:39:46 2010 +0000
@@ -182,7 +182,7 @@ sub ReplyPage
LJ::CleanHTML::clean_comment(\$parpost->{'body'},
{
'preformatted' =>
$parpost->{'props'}->{'opt_preformatted'},
- 'anon_comment' =>
!$parpost->{posterid} || $pu->is_identity,
+ 'anon_comment' =>
!$parpost->{posterid} || ( $pu->is_identity && !$u->trusts_or_has_member( $pu )
),
});
diff -r 1da32e20a5ee -r 666dca7810f8 cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm Sat Feb 13 01:40:19 2010 +0000
+++ b/cgi-bin/LJ/Talk.pm Sun Feb 14 03:39:46 2010 +0000
@@ -1860,6 +1860,9 @@ LOGIN
if ($journalu->opt_logcommentips eq "S") {
$ret .= "<br />$BML::ML{'.loganonip'}";
$ret .= LJ::help_icon_html("iplogging", " ");
+ }
+ if ( !$remote || ( $remote && $remote->is_identity &&
!$journalu->trusts_or_has_member( $remote ) ) ) {
+ $ret .= "<br />$BML::ML{'.linkstripped'}";
}
$ret .= LJ::html_hidden( editid => $editid );
diff -r 1da32e20a5ee -r 666dca7810f8 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl Sat Feb 13 01:40:19 2010 +0000
+++ b/cgi-bin/weblib.pl Sun Feb 14 03:39:46 2010 +0000
@@ -831,6 +831,10 @@ QQ
$qrhtml .= '<br />';
$qrhtml .= LJ::deemp(BML::ml('/talkpost.bml.logyourip'));
$qrhtml .= LJ::help_icon_html("iplogging", " ");
+ }
+ if ( !$remote || ( $remote && $remote->is_identity &&
!$u->trusts_or_has_member( $remote ) ) ) {
+ $qrhtml .= '<br />';
+ $qrhtml .= LJ::deemp( BML::ml( '/talkpost.bml.linkstripped' ) );
}
$qrhtml .= "</td></tr></table>";
diff -r 1da32e20a5ee -r 666dca7810f8 htdocs/talkpost.bml.text
--- a/htdocs/talkpost.bml.text Sat Feb 13 01:40:19 2010 +0000
+++ b/htdocs/talkpost.bml.text Sun Feb 14 03:39:46 2010 +0000
@@ -36,6 +36,8 @@
.noedithtml=No HTML allowed in reason for edit
.nosubjecthtml=No HTML allowed in subject
+
+.linkstripped=Links will be displayed as unclickable URLs to help prevent spam.
.opt.anonymous=Anonymous
diff -r 1da32e20a5ee -r 666dca7810f8 htdocs/talkread.bml
--- a/htdocs/talkread.bml Sat Feb 13 01:40:19 2010 +0000
+++ b/htdocs/talkread.bml Sun Feb 14 03:39:46 2010 +0000
@@ -676,7 +676,7 @@ body<=
$ret .= "</td></tr><tr><td class='commentbody usercontent'>";
LJ::CleanHTML::clean_comment(\$post->{'body'}, {
'preformatted' => $post->{'props'}->{'opt_preformatted'},
-
'anon_comment' => ( !$pu || $pu->is_identity ),
+
'anon_comment' => !$pu || ( $pu->is_identity && !$u->trusts_or_has_member( $pu
) ),
});
BML::ebml(\$post->{'body'});
my $event = $post->{'body'};
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog