Remove links in subjects in some views so users can still click through 
to the entry.

        Patch by afuna. 

diffs (23 lines):

diff -r fc55d1b97341 -r a287fe71fadf cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm  Tue Jan 05 01:49:23 2010 +0000
+++ b/cgi-bin/LJ/S2.pm  Tue Jan 05 22:38:23 2010 +0000
@@ -3553,12 +3553,15 @@ sub EntryLite__formatted_subject {
         }
     }
 
-    # if subject has a link and is not collapsed display raw subject
+
+    # display subject as-is (cleaned but not wrapped in a link)
+    # if subject has a link and we are on a full comment/single entry view and 
don't need to click through
     # TODO: how about other HTML tags?
-    if ( $subject =~ /href/ && $this->{full} ) {
+    if ( $subject =~ /href/ && ( $this->{full} || $LJ::S2::CURR_PAGE->{view} 
eq "reply" ||  $LJ::S2::CURR_PAGE->{view} eq "entry" ) ) {
         return $subject;
-
-    } else {
+    } else {
+        # we need to be able to click through this subject, so remove links
+        LJ::CleanHTML::clean( \$subject, { noexpandembedded => 1, mode => 
"allow", remove => [ "a" ] } );
         my $class = $attrs->{class} ? " class=\"" . LJ::ehtml( $attrs->{class} 
) . "\" " : '';
         my $style = $attrs->{style} ? " style=\"" . LJ::ehtml( $attrs->{style} 
) . "\" " : '';
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to