From 1dba651ea14cd13032d7fa451768458568566416 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 31 Dec 2003 17:31:50 +0000 Subject: [PATCH] merging 5.5.4 bugfixes --- lib/WebGUI/FormProcessor.pm | 2 +- lib/WebGUI/Forum/UI.pm | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/WebGUI/FormProcessor.pm b/lib/WebGUI/FormProcessor.pm index e411f746d..e7f9b65eb 100644 --- a/lib/WebGUI/FormProcessor.pm +++ b/lib/WebGUI/FormProcessor.pm @@ -211,7 +211,7 @@ The name of the form variable to retrieve. =cut sub email { - if ($session{form}{$_[0]} =~ /^([A-Z0-9]+[._-]?){1,}[A-Z0-9]+\@(([A-Z0-9]+[-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i) { + if ($session{form}{$_[0]} =~ /^([A-Z0-9]+[._-]?){1,}[A-Z0-9]+\@(([A-Z0-9]+[._-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i) { return $session{form}{$_[0]}; } return undef; diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 1fa3286d2..c7209cb35 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -57,7 +57,7 @@ User interface package for forums. $scalar = WebGUI::Forum::UI::formatPostTime($epoch); $url = WebGUI::Forum::UI::formatPreviousThreadURL($callback, $postId); $url = WebGUI::Forum::UI::formatRatePostURL($callback, $postId, $rating); - $url = WebGUI::Forum::UI::formatReplyPostURL($callback, $postId); + $url = WebGUI::Forum::UI::formatReplyPostURL($callback, $postId, $forumId); $scalar = WebGUI::Forum::UI::formatStatus($status); $scalar = WebGUI::Forum::UI::formatSubject($subject); $url = WebGUI::Forum::UI::formatThreadLayoutURL($callback, $postId, $layout); @@ -495,7 +495,7 @@ sub formatRatePostURL { #------------------------------------------------------------------- -=head2 formatReplyPostURL ( callback, postId [ , withQuote ] ) +=head2 formatReplyPostURL ( callback, postId, forumId [ , withQuote ] ) Formats the url to reply to a post. @@ -509,6 +509,10 @@ The url to get back tot he calling object. The unique id for the post. +=item forumId + +The unique id for the forum. + =item withQuote If specified the reply with automatically quote the parent post. @@ -518,8 +522,8 @@ If specified the reply with automatically quote the parent post. =cut sub formatReplyPostURL { - my $url = WebGUI::URL::append($_[0],"forumOp=post&parentId=".$_[1]); - $url = WebGUI::URL::append($url,"withQuote=1") if ($_[2]); + my $url = WebGUI::URL::append($_[0],"forumOp=post&parentId=".$_[1]."&forumId=".$_[2]); + $url = WebGUI::URL::append($url,"withQuote=1") if ($_[3]); return $url; } @@ -1217,8 +1221,8 @@ sub getPostTemplateVars { $var->{'post.rate.url.5'} = formatRatePostURL($callback,$post->get("forumPostId"),5); $var->{'post.hasRated'} = $post->hasRated; $var->{'post.reply.label'} = WebGUI::International::get(577); - $var->{'post.reply.url'} = formatReplyPostURL($callback,$post->get("forumPostId")); - $var->{'post.reply.withquote.url'} = formatReplyPostURL($callback,$post->get("forumPostId"),1); + $var->{'post.reply.url'} = formatReplyPostURL($callback,$post->get("forumPostId"),$forum->get("forumId")); + $var->{'post.reply.withquote.url'} = formatReplyPostURL($callback,$post->get("forumPostId"),$forum->get("forumId"),1); $var->{'post.edit.label'} = WebGUI::International::get(575); $var->{'post.edit.url'} = formatEditPostURL($callback,$post->get("forumPostId")); $var->{'post.delete.label'} = WebGUI::International::get(576); @@ -1776,8 +1780,12 @@ sub www_post { name=>'parentId', value=>$reply->get("forumPostId") }); - $message = "[quote]".$reply->get("message")."[/quote]" if ($session{form}{withQuote}); $forum = $reply->getThread->getForum; + $var->{'form.begin'} .= WebGUI::Form::hidden({ + name=>'forumId', + value=>$forum->get("forumId") + }); + $message = "[quote]".$reply->get("message")."[/quote]" if ($session{form}{withQuote}); $var = getPostTemplateVars($reply, $reply->getThread, $forum, $caller, $var); $subject = $reply->get("subject");