$spam_words = [ 'go.tazalus.com', 'porn', 'dating', 'hierbalimon.es', 'bodyandsoul', 'promo', 'puertobelenn', 'faiterde.tk', 'tygyguip', 'maritim-touristik', 'toolbarqueries', 'allnews.elk.pl', 'fuck', 'delicatedate.net', 'allcnews.xyz', 'allcryptonnews', 'hinebixi.com', 'obermatsa', 'hilkom-digital.de', 'monkeydigital.co', 'CrytoPRove', 'no-site.com', 'strictlydigital', 'youtu.be', 'wilhetiperbe', 'blogspot.com', 'suck', 'dana@parkcitynursery.com', 'suqomuaq.com', 'semrush', 'diryjyaz.com', 'obermatsa.com', 'hinebixi.com', 'rarealnojahr.gq', 'osii@eff.effect.edu.pl', 'Injek@gmail.com', 'WhatsApp-Nummer', 'osii@eff.effect.edu.pl', 'smtpfox-upyca@marflex.s1.clickrlabs.com', 'osii@eff.effect.edu.pl', 'Jarosz-Opolka', 'peter.behrmann@gmx.de' ]; function strposa( $haystack, $needles = array(), $offset = 0 ) { $chr = array(); foreach ( $needles as $needle ) { $res = strpos($haystack, $needle, $offset); if ($res !== false) $chr[$needle] = $res; } if ( empty($chr) ) return false; return min($chr); } function saveContactData($email, $phone, $companyName, $typeCooperation, $message) { $contactHistoryFile = $_SERVER['DOCUMENT_ROOT'] . '/autoinstalator/wordpress/forms.csv'; $contactData = array( 'Email' => $email, 'Phone' => $phone, 'Company' => $companyName, 'Cooperation' => $typeCooperation, 'Message' => $message, 'Timestamp' => date('Y-m-d H:i:s', time()) ); if (!file_exists($contactHistoryFile)) { $header = array_keys($contactData); $history = array($header); } else { $history = array_map('str_getcsv', file($contactHistoryFile)); } $history[] = $contactData; $csvContent = fopen($contactHistoryFile, 'w'); foreach ($history as $row) { fputcsv($csvContent, $row); } fclose($csvContent); } if ( \S::get( 'action' ) == 'send_contact_form' and \S::get( 'token' ) == \S::get_session( 'form-token' ) and !\S::get( 'website' ) ) { if(isset($_POST['g-recaptcha-response'])){ $captcha=$_POST['g-recaptcha-response']; } if(!$captcha){ \S::alert( "reCaptcha-Überprüfung fehlgeschlagen. Bitte versuche es erneut." ); header( 'Location: ' . $_SERVER['REQUEST_URI'] ); exit; } $secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4"; $ip = $_SERVER['REMOTE_ADDR']; // post request to server $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha); $response = file_get_contents($url); $responseKeys = json_decode($response,true); // should return JSON with success as true if($responseKeys["success"]) { if ( \S::get( 'email' ) and strposa( $_POST['type_cooperation'], $spam_words ) === false and strposa( $_POST['company_name'], $spam_words ) === false and strposa( $_POST['email'], $spam_words ) === false and strposa( $_POST['phone'], $spam_words ) === false and strposa( $_POST['your_message'], $spam_words ) === false ) { $text = '
Rodzaj współpracy: ' . \S::get( 'type_cooperation' ) . '
'; $text .= 'Firma: ' . \S::get( 'company_name' ) . '
'; $text .= 'Email: ' . \S::get( 'email' ) . '
'; $text .= 'Telefon: ' . \S::get( 'phone' ) . '
'; $text .= 'Wiadomość: ' . nl2br(\S::get('your_message')) . '
'; $text .= 'Wysłano: ' . date( 'Y-m-d H:i:s' ) . '
'; // anfrage@vidok.com // roman.pyrih@project-pro.pl if ( \S::send_email( 'anfrage@vidok.com', 'Wiadomość ze strony de.vidok.com', $text, \S::get( 'inputEmail' ) ) ) { saveContactData( \S::get( 'email' ), \S::get( 'phone' ), \S::get( 'company_name' ), \S::get( 'type_cooperation' ), nl2br(\S::get('your_message')) ); \S::alert( 'Das Formular wurde gesendet.' ); } else { \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); } } else { \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); } } else { \S::alert( "Du bist Boot! 4" ); } header( 'Location: ' . $_SERVER['REQUEST_URI'] ); exit; }