Forum Replies Created
-
AuthorPosts
-
pertzschcParticipant
Yesterday I did post a solution to patch subscription.php, now I will share an improved version:
…
// Shound never reach this point without a valid email address
if ($email == null) {
die(‘Wrong email’);
}// begin patch for blocking all mail adresses ending with “*.ru”
$endStr = “.ru”;
if (substr($email, strlen($email)-strlen($endStr), strlen($endStr)) === $endStr) {
$this->logger->info(‘Subscription of “*.ru” – address blocked: ‘ . $email);
die();
}
// end patch for blocking all mail adresses ending with “*.ru”$user = $newsletter->get_user($email);
…Please search the statements and copy in the // patch…
It will block all subscriptions with mail adresses ending with “*.ru”.And no, it will not prevent to make a subscription with “mail.ru2” 😉
Christoph
pertzschcParticipantDJDaniel wrote:
I added this into the subscription.php
It doesn’t work, trying to reactivate the Newsletter Plugin I got the followig Error:
Parse error: syntax error, unexpected ‘of’ (T_STRING) in /homepages/…./wp-content/plugins/newsletter/subscription/subscription.php on line 399
Line 399 Contains $this->logger->info(‘Subscription of “mail.ru” – address blocked: ‘ . $email);
Please check for your PHP-version, what is the regular character for define a string, as there are many possibilities:
“”, ”,, ‘‘.
I think, that the <‘> is causing your issue, please try <‘> first.
ChristophpertzschcParticipantHi all,
my (temporary) solution is, to block all “*mail.ru” adresses for subscription. If this fits for your needs, please adapt the following lines in the file: ..\wp-content\plugins\newsletter\subscription\subscription.php:search for this next comment statement in the file and insert the block “// begin patch for mail.ru”
…
// Shound never reach this point without a valid email address
if ($email == null) {
die(‘Wrong email’);
}
// begin patch for mail.ru
$email_contains_ru = strpos($email, “mail.ru”); // outputs greater 0 if found
if ($email_contains_ru > “0”) {
$this->logger->info(‘Subscription of “mail.ru” – address blocked: ‘ . $email);
die();
}
// end patch for mail.ru$user = $newsletter->get_user($email);
…Kind regards,
ChristophpertzschcParticipantI have the same issue on my webside.
“No option available to prevent them from directly accessing the registration url?”
What is the registration url?Kind regards, Christoph
-
AuthorPosts