$username = PMF_Filter::filterInput(INPUT_POST, 'user', FILTER_SANITIZE_STRING); $mail = PMF_Filter::filterInput(INPUT_POST, 'mail', FILTER_VALIDATE_EMAIL); $comment = PMF_Filter::filterInput(INPUT_POST, 'comment_text', FILTER_SANITIZE_SPECIAL_CHARS); switch ($type) { case 'news': $id = $newsid; break; case 'faq': $id = $faqid; break; } // If e-mail address is set to optional if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($mail)) { $mail = PMF_Configuration::getInstance()->get('main.administrationMail'); } if (!is_null($username) && !empty($username) && !empty($mail) && !is_null($mail) && !is_null($comment) && !empty($comment) && checkBannedWord($comment) && !$faq->commentDisabled($id, $languageCode, $type)) { $faqsession->userTracking("save_comment", $id); $commentData = array('record_id' => $id, 'type' => $type, 'username' => $username, 'usermail' => $mail, 'comment' => nl2br($comment), 'date' => $_SERVER['REQUEST_TIME'], 'helped' => ''); if ($faq->addComment($commentData)) { $emailTo = $faqconfig->get('main.administrationMail'); $urlToContent = ''; if ('faq' == $type) { $faq->getRecord($id); if ($faq->faqRecord['email'] != '') { $emailTo = $faq->faqRecord['email']; } $_faqUrl = sprintf('?action=artikel&cat=%d&id=%d&artlang=%s', 0, $faq->faqRecord['id'], $faq->faqRecord['lang']); $oLink = new PMF_Link(PMF_Link::getSystemUri('/ajaxservice.php') . $_faqUrl); $oLink->itemTitle = $faq->faqRecord['title']; $urlToContent = $oLink->toString(); } else {