From: Victor Wagner
Date: Fri, 4 Apr 2008 19:56:27 +0000 (+0000)
Subject: Fixed HTML escaping when _format set to text
X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=d0acd3927cbe4e0f7e4faccca7ef6dd68911ecd5;p=oss%2Fstilllife.git
Fixed HTML escaping when _format set to text
---
diff --git a/forum/forum b/forum/forum
index 7cb882b..bc68545 100755
--- a/forum/forum
+++ b/forum/forum
@@ -262,7 +262,7 @@ sub show_error {
print $cgi->header(-type=>'text/html',-charset=>'utf-8');
print "ÐÑибка конÑигÑÑаÑии ÑоÑÑма",
"ÐÑибка конÑигÑÑаÑии ÑоÑÑма
",
- $cgi->escapeHTML($msg),"
",
+ escapeHTML($msg),"
",
"ÐÑи обÑабоÑке ÑÑой оÑибки не обнаÑÑжен Ñаблон ÑообÑÐµÐ½Ð¸Ñ Ð¾Ð± оÑибке
";
}
exit;
@@ -1479,7 +1479,7 @@ sub delete_comment {
my ($cgi,$forum,$topic,$id) = @_;
my ($tree,$lockfd) = gettree($topic);
my ($msg) = $tree->look_down(id => $id);
- show_error("Рданной Ñеме Ð½ÐµÑ Ñеплики Ñ id=$id") if (!$msg);
+ show_error($forum,"Рданной Ñеме Ð½ÐµÑ Ñеплики Ñ id=$id") if (!$msg);
if (getrights($cgi,$forum) ne "moderator"
&& getrights($cgi,$forum) ne "admin") {
my $author= $msg->look_down(_tag=>"input",name=>"author");
@@ -1910,7 +1910,7 @@ sub input2tree {
} elsif ($format eq "text") {
$text=~s/\r?\n\r?\n/<\/p>/;
$text=~s/\r?\n/
/;
- $text = "
";
+ $text = "";
}
my $txtree = str2tree($text);
for my $badtag
@@ -1920,7 +1920,7 @@ sub input2tree {
$element->delete() if defined $element;
}
}
- # ÐÑовеÑÑем на налиÑие URL-ок не оÑоÑмленнÑÑ
ÑÑÑлками.
+ # FIXME ÐÑовеÑÑем на налиÑие URL-ок не оÑоÑмленнÑÑ
ÑÑÑлками.
return $txtree;
}
@@ -2065,3 +2065,10 @@ sub newlistelement {
}
}
+sub escapeHTML {
+ local $_ = shift;
+ s/\&/&/g;
+ s/\</g;
+ s/\>/>/g;
+ return $_;
+}