Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Correctly send the comment moderation mails (see #5443)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Mar 6, 2013
1 parent 45004ac commit 7a1d4a3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions contao/classes/Comments.php
Expand Up @@ -33,9 +33,9 @@ class Comments extends \Frontend
* @param \stdClass
* @param string
* @param integer
* @param array
* @param mixed
*/
public function addCommentsToTemplate(\FrontendTemplate $objTemplate, \stdClass $objConfig, $strSource, $intParent, $arrNotifies)
public function addCommentsToTemplate(\FrontendTemplate $objTemplate, \stdClass $objConfig, $strSource, $intParent, $varNotifies)
{
global $objPage;

Expand Down Expand Up @@ -172,7 +172,7 @@ public function addCommentsToTemplate(\FrontendTemplate $objTemplate, \stdClass
$objTemplate->commentsTotal = $limit ? $gtotal : $total;

// Add a form to create new comments
$this->renderCommentForm($objTemplate, $objConfig, $strSource, $intParent, $arrNotifies);
$this->renderCommentForm($objTemplate, $objConfig, $strSource, $intParent, $varNotifies);
}


Expand All @@ -182,9 +182,9 @@ public function addCommentsToTemplate(\FrontendTemplate $objTemplate, \stdClass
* @param \stdClass
* @param string
* @param integer
* @param array
* @param mixed
*/
protected function renderCommentForm(\FrontendTemplate $objTemplate, \stdClass $objConfig, $strSource, $intParent, $arrNotifies)
protected function renderCommentForm(\FrontendTemplate $objTemplate, \stdClass $objConfig, $strSource, $intParent, $varNotifies)
{
$this->import('FrontendUser', 'User');

Expand Down Expand Up @@ -392,9 +392,13 @@ protected function renderCommentForm(\FrontendTemplate $objTemplate, \stdClass $
\Environment::get('base') . 'contao/main.php?do=comments&act=edit&id=' . $objComment->id);

// Do not send notifications twice
if (is_array($arrNotifies))
if (is_array($varNotifies))
{
$objEmail->sendTo(array_unique($arrNotifies));
$objEmail->sendTo(array_unique($varNotifies));
}
elseif ($varNotifies != '')
{
$objEmail->sendTo($varNotifies); // see #5443
}

// Pending for approval
Expand Down

0 comments on commit 7a1d4a3

Please sign in to comment.