$result = $mail->send(); unset($mail); $message = array('success' => $PMF_LANG['msgMailContact']); } else { $message = array('error' => $PMF_LANG['err_sendMail']); } break; // Send mails to friends // Send mails to friends case 'sendtofriends': $name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING); $email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); $link = PMF_Filter::filterInput(INPUT_POST, 'link', FILTER_VALIDATE_URL); $attached = PMF_Filter::filterInput(INPUT_POST, 'message', FILTER_SANITIZE_STRIPPED); $mailto = PMF_Filter::filterInputArray(INPUT_POST, array('mailto' => array('filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_REQUIRE_ARRAY | FILTER_NULL_ON_FAILURE))); if (!is_null($name) && !empty($name) && !is_null($email) && !empty($email) && is_array($mailto) && !empty($mailto['mailto'][0]) && checkBannedWord(PMF_String::htmlspecialchars($attached))) { foreach ($mailto['mailto'] as $recipient) { $recipient = trim(strip_tags($recipient)); if (!empty($recipient)) { $mail = new PMF_Mail(); $mail->setReplyTo($email, $name); $mail->addTo($recipient); $mail->subject = $PMF_LANG["msgS2FMailSubject"] . $name; $mail->message = sprintf("%s\r\n\r\n%s\r\n%s\r\n\r\n%s", $faqconfig->get('main.send2friendText'), $PMF_LANG['msgS2FText2'], $link, $attached); // Send the email $result = $mail->send(); unset($mail); usleep(250); } } $message = array('success' => $PMF_LANG['msgS2FThx']);
switch ($type) { case 'news': $id = $newsid; $msgWriteComment = $PMF_LANG['newsWriteComment']; break; case 'faq': default: $id = $faqid; $msgWriteComment = $PMF_LANG['msgWriteComment']; 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($user) && !is_null($mail) && !is_null($comment) && checkBannedWord(PMF_String::htmlspecialchars($comment)) && IPCheck($_SERVER['REMOTE_ADDR']) && $captcha->checkCaptchaCode($code) && !$faq->commentDisabled($id, $LANGCODE, $type)) { $faqsession->userTracking("save_comment", $id); $commentData = array('record_id' => $id, 'type' => $type, 'username' => $user, '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('%saction=artikel&cat=%d&id=%d&artlang=%s', $sids, 0, $faq->faqRecord['id'], $faq->faqRecord['lang']); $oLink = new PMF_Link(PMF_Link::getSystemUri() . '?' . $_faqUrl); $oLink->itemTitle = $faq->faqRecord['title']; $urlToContent = $oLink->toString(); } else {
* @link http://www.phpmyfaq.de * @since 2002-09-16 */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $faqsession->userTracking('sendmail_send2friend', 0); $captcha = new PMF_Captcha($sids); $name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING); $mailfrom = PMF_Filter::filterInput(INPUT_POST, 'mailfrom', FILTER_VALIDATE_EMAIL); $mailto = PMF_Filter::filterInputArray(INPUT_POST, array('mailto' => array('filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_REQUIRE_ARRAY | FILTER_NULL_ON_FAILURE))); $link = PMF_Filter::filterInput(INPUT_POST, 'link', FILTER_VALIDATE_URL); $attached = PMF_Filter::filterInput(INPUT_POST, 'zusatz', FILTER_SANITIZE_STRIPPED); $code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING); if (!is_null($name) && !is_null($mailfrom) && is_array($mailto) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($attached)) && $captcha->checkCaptchaCode($code)) { // Backward compatibility: extract article info from the link, no template change required $cat = $id = $artlang = null; preg_match('`index\\.php\\?action=artikel&cat=(?<cat>[\\d]+)&id=(?<id>[\\d]+)&artlang=(?<artlang>[^$]+)$`', $link, $matches); if (isset($matches['cat'])) { $cat = (int) $matches['cat']; } if (isset($matches['id'])) { $id = (int) $matches['id']; } if (isset($matches['artlang'])) { $artlang = $matches['artlang']; } // Sanity check if (is_null($cat) || is_null($id) || is_null($artlang)) { header('HTTP/1.1 403 Forbidden');
* @since 2002-09-17 */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $faqsession->userTracking('sendmail_contact', 0); $captcha = new PMF_Captcha($sids); $name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING); $email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); $question = PMF_Filter::filterInput(INPUT_POST, 'question', FILTER_SANITIZE_STRIPPED); $code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING); // If e-mail address is set to optional if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($email)) { $email = PMF_Configuration::getInstance()->get('main.administrationMail'); } if (!is_null($name) && !is_null($email) && !is_null($question) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($question)) && $captcha->checkCaptchaCode($code)) { $mail = new PMF_Mail(); $mail->unsetFrom(); $mail->setFrom($email, $name); $mail->addTo($faqconfig->get('main.administrationMail')); $mail->subject = 'Feedback: %sitename%'; $mail->message = $question; $result = $mail->send(); unset($mail); $message = $PMF_LANG['msgMailContact']; } else { $message = $PMF_LANG['err_sendMail']; } $tpl->processTemplate('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'Message' => $message)); $tpl->includeTemplate('writeContent', 'index');
* Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } Tracking("sendmail_send2friend", 0); $captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']); if (isset($_POST['name']) && $_POST['name'] != '' && isset($_POST['mailfrom']) && $_POST['mailfrom'] != '' && isset($_POST['mailto']) && $_POST['mailto'] != '' && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(htmlspecialchars(strip_tags($_POST['zusatz']))) && checkCaptchaCode()) { $name = $db->escape_string(strip_tags($_POST["name"])); $mailfrom = $db->escape_string(strip_tags($_POST["mailfrom"])); $link = $db->escape_string(strip_tags($_POST["link"])); $attached = $db->escape_string(strip_tags($_POST["zusatz"])); $mailto = $_POST['mailto']; list($user, $host) = explode("@", $mailto[0]); if (checkEmail($mailfrom)) { foreach ($mailto as $mail) { $mail = $db->escape_string(strip_tags($mail)); if ($mail != "") { mail($IDN->encode($mail), $PMF_LANG["msgS2FMailSubject"] . $name, $PMF_CONF["send2friend_text"] . "\n\n" . $PMF_LANG["msgS2FText2"] . "\n" . $link . "\n\n" . $attached, "From: " . $IDN->encode($mailfrom)); usleep(500); } } $tpl->processTemplate("writeContent", array("msgSend2Friend" => $PMF_LANG["msgSend2Friend"], "Message" => $PMF_LANG["msgS2FThx"]));
$thema = PMF_Filter::filterInput(INPUT_POST, 'thema', FILTER_SANITIZE_STRIPPED); $content = PMF_Filter::filterInput(INPUT_POST, 'content', FILTER_SANITIZE_STRIPPED); $tr_content = PMF_Filter::filterInput(INPUT_POST, 'translated_content', FILTER_SANITIZE_STRING); $contentlink = PMF_Filter::filterInput(INPUT_POST, 'contentlink', FILTER_VALIDATE_URL); $keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords', FILTER_SANITIZE_STRIPPED); $code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING); $categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY))); // If e-mail address is set to optional if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($usermail)) { $usermail = PMF_Configuration::getInstance()->get('main.administrationMail'); } // Check on translation if (is_null($content) && !is_null($tr_content)) { $content = $tr_content; } if (!is_null($username) && !is_null($usermail) && !is_null($thema) && !is_null($content) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($thema)) && checkBannedWord(PMF_String::htmlspecialchars($content)) && $captcha->checkCaptchaCode($code) && (is_null($faqid) && !is_null($categories) || !is_null($faqid) && !is_null($faqlanguage) && PMF_Language::isASupportedLanguage($faqlanguage))) { $isNew = true; if (!is_null($faqid)) { $isNew = false; $faqsession->userTracking('save_new_translation_entry', 0); } else { $faqsession->userTracking('save_new_entry', 0); } $isTranslation = false; if (!is_null($faqlanguage)) { $isTranslation = true; $newLanguage = $faqlanguage; } if (PMF_String::substr($contentlink, 7) != "") { $content = $content . "<br />" . $PMF_LANG["msgInfo"] . "<a href=\"http://" . PMF_String::substr($contentlink, 7) . "\" target=\"_blank\">" . $contentlink . "</a>"; }
$mainAdminEmail = $faqconfig->get('main.administrationMail'); $mail = new PMF_Mail(); $mail->unsetFrom(); $mail->setFrom($questionData['email'], $questionData['username']); $mail->addTo($mainAdminEmail); // Let the category owner get a copy of the message if ($userEmail && $mainAdminEmail != $userEmail) { $mail->addCc($userEmail); } $mail->subject = '%sitename%'; $mail->message = $questionMail; $retval = $mail->send(); } return $retval; } if (!is_null($username) && !empty($usermail) && !empty($content) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($content)) && $captcha->checkCaptchaCode($code)) { $pmf_sw = PMF_Stopwords::getInstance(); $search_stuff = $pmf_sw->clean($content); $search = new PMF_Search($db, $Language); $search_result = array(); $counter = 0; foreach ($search_stuff as $word) { $tmp = $search->search($word); foreach ($tmp as $foundItem) { if (!isset($foundItem->id, $search_result[$foundItem->category_id])) { $counter++; $foundItem->searchterm = PMF_String::htmlspecialchars(stripslashes($word), ENT_QUOTES, 'utf-8'); $search_result[$foundItem->category_id][$foundItem->id] = $foundItem; } } }
* The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']); if (isset($_POST['username']) && $_POST['username'] != '' && isset($_POST['usermail']) && checkEmail($_POST['usermail']) && isset($_POST['content']) && $_POST['content'] != '' && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(htmlspecialchars(strip_tags($_POST['content']))) && checkCaptchaCode()) { if (isset($_POST['try_search'])) { $suchbegriff = strip_tags($_POST['content']); $printResult = searchEngine($suchbegriff, $numr); echo $numr; } else { $numr = 0; } if ($numr == 0) { $cat = new category(); $categories = $cat->getAllCategories(); $usermail = $db->escape_string($IDN->encode($_POST['usermail'])); $username = $db->escape_string(strip_tags($_POST['username'])); $selected_category = intval($_POST['rubrik']); list($user, $host) = explode("@", $usermail); if (checkEmail($usermail)) {
* Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } Tracking("sendmail_contact", 0); $captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']); if (isset($_POST["name"]) && $_POST["name"] != '' && isset($_POST["email"]) && checkEmail($_POST["email"]) && isset($_POST["question"]) && $_POST["question"] != '' && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(htmlspecialchars(strip_tags($_POST['question']))) && checkCaptchaCode()) { list($user, $host) = explode("@", $_POST["email"]); $question = htmlspecialchars($_POST["question"]); $sender = $IDN->encode($_POST["email"]); $subject = 'Feedback: ' . $PMF_CONF['title']; $name = htmlspecialchars($_POST['name']); if (function_exists('mb_encode_mimeheader')) { $name = mb_encode_mimeheader($name); } else { $name = encode_iso88591($name); } $additional_header = array(); $additional_header[] = 'MIME-Version: 1.0'; $additional_header[] = 'Content-Type: text/plain; charset=' . $PMF_LANG['metaCharset']; if (strtolower($PMF_LANG['metaCharset']) == 'utf-8') { $additional_header[] = 'Content-Transfer-Encoding: 8bit';