/mobile/friends.bml has issues

Jan 11, 2007 08:27


# /trunk/htdocs/mobile/friends.bml
$entry = LJ::Entry->new(...);
$ret .= "$who: " . " " . ($entry->subject_html || "(no subject)") . "
";

Entry::subject_html() {
[...]
LJ::CleanHTML::clean_subject( \$subject )
[...]
}

Entry::subject_text() {
[...]
LJ::CleanHTML::clean_subject_all( \$subject )
[...]
}

my $subject_eat = [qw[head title style layer iframe applet object param]];
my $subject_allow = [qw[a b i u em strong cite]];
my $subject_remove = [qw[bgsound embed object caption link font noscript]];
sub clean_subject
{
my $ref = shift;
return unless $$ref =~ /[\<\>]/;
clean($ref, {
'wordlength' => 40,
'addbreaks' => 0,
'eat' => $subject_eat,
'mode' => 'deny',
'allow' => $subject_allow,
'remove' => $subject_remove,
'autoclose' => $subject_allow,
'noearlyclose' => 1,
});
}

## returns a pure text subject (needed in links, email headers, etc...)
my $subjectall_eat = [qw[head title style layer iframe applet object]];
sub clean_subject_all
{
my $ref = shift;
return unless $$ref =~ /[\<\>]/;
clean($ref, {
'wordlength' => 40,
'addbreaks' => 0,
'eat' => $subjectall_eat,
'mode' => 'deny',
'textonly' => 1,
'autoclose' => $subject_allow,
'noearlyclose' => 1,
});
}so. instead of $entry->subject_html it should be $entry->subject_text.

lj, lj: changelog

Previous post Next post
Up