SQL quoting fix, re Bug [1059647]

This commit is contained in:
Colin Kuskie 2004-11-04 06:48:22 +00:00
parent 3438a0b5a5
commit 1722c0ab7b

View file

@ -2046,7 +2046,7 @@ sub www_search {
$var{'post.user.label'} = WebGUI::International::get(244);
my $constraints = WebGUI::Search::buildConstraints([qw(a.subject a.username a.message)]);
my $query = "select a.forumPostId, a.subject, a.userId, a.username, a.dateOfPost from forumPost a left join forumThread b
on a.forumThreadId=b.forumThreadId where b.forumId=".$forum->get("forumId")." and
on a.forumThreadId=b.forumThreadId where b.forumId=".quote($forum->get("forumId"))." and
(a.status='approved' or a.status='archived') and $constraints order by a.dateOfPost desc";
my $p = WebGUI::Paginator->new(WebGUI::URL::append($caller->{callback},"forumOp=search&doit=1&forumId=".$forum->get("forumId")), $numResults);
$p->setDataByQuery($query) if $constraints;