Commit e8c47626 authored by Kurt Trowbridge's avatar Kurt Trowbridge Committed by mrweiner
Browse files

Issue #3096773 by KurtTrowbridge, roman.haluska, Deeksha B, mrweiner,...

Issue #3096773 by KurtTrowbridge, roman.haluska, Deeksha B, mrweiner, maxilein: Drupal 9 Deprecated Code Report
parent 90e36691
Loading
Loading
Loading
Loading
+1 −1
Changes for config/schema/httpbl.schema.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ httpbl.settings:
        httpbl_grey_threshold:
          type: integer
          label: 'Greylisting Threshhold'
        httpbl_message_black:
        httpbl_message_grey:
          type: string
          label: 'Greylist message'
        httpbl_safe_offset:
+12 −12
Changes for drush/httpbl.drush.inc: 12 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -95,11 +95,11 @@ function drush_httpbl_sos($ip = '127.0.0.1') {
  if ($banManager->isBanned($ip)) {
    $banManager->unbanIp($ip);
    $logMessage = t('Drush SOS unbanned @ip.', ['@ip' => $ip]);
    drush_log(dt($logMessage), 'ok');
    \Drupal::logger(dt($logMessage))->info( 'ok');
    \Drupal::logger('httpbl')->notice($logMessage);
  }
  else {
    drush_log(dt('@ip was not banned.', ['@ip' => $ip]), 'ok');
    \Drupal::logger(dt('@ip was not banned.', ['@ip' => $ip]))->info( 'ok');
  }

  // Get Evaluator service and whitelist this IP.
@@ -109,11 +109,11 @@ function drush_httpbl_sos($ip = '127.0.0.1') {
  if ($status != 0) {
    $httpblEvaluator->drushWhitelist($ip);
    $logMessage = t('Drush SOS whitelisted @ip.', ['@ip' => $ip]);
    drush_log(dt($logMessage), 'ok');
    \Drupal::logger(dt($logMessage))->info( 'ok');
    \Drupal::logger('httpbl')->notice($logMessage);
  }
  else {
    drush_log(dt('@ip was already white-listed or was not found.', ['@ip' => $ip]), 'ok');
    \Drupal::logger(dt('@ip was already white-listed or was not found.', ['@ip' => $ip]))->info( 'ok');
  }

  // Stop option:
@@ -127,7 +127,7 @@ function drush_httpbl_sos($ip = '127.0.0.1') {
  elseif (drush_get_option('start', FALSE)) {
    $command = drush_state_set($key = 'httpbl.check', $value = 2);
    $logMessage = t('Drush SOS started or restarted Httpbl page checking/blocking.');
    drush_log(dt($logMessage), 'ok');
    \Drupal::logger(dt($logMessage))->info('ok');
     \Drupal::logger('httpbl')->notice($logMessage);
    return $command;
  }
@@ -156,7 +156,7 @@ function drush_httpbl_mho($max = 255, $status = 0, $offset = 300, $pattern = '12
  // Get Evaluator service and whitelist this IP.
  $httpblEvaluator = \Drupal::service('httpbl.evaluator');
  $command = $httpblEvaluator->makeHosts($max, $status, $offset, $pattern);
  drush_log(dt($logMessage), 'ok');
  \Drupal::logger(dt($logMessage))->info( 'ok');
  return $command;
}

@@ -171,7 +171,7 @@ function drush_httpbl_mbb($max = 255, $offset = 300, $pattern = '127.1.8.' ) {
  // Get Evaluator service and whitelist this IP.
  $httpblEvaluator = \Drupal::service('httpbl.evaluator');
  $command = $httpblEvaluator->makeBannedHosts($max, $offset, $pattern);
  drush_log(dt($logMessage), 'ok');
  \Drupal::logger(dt($logMessage))->info( 'ok');
  return $command;
}

@@ -186,11 +186,11 @@ function drush_httpbl_sol($ip = '127.0.0.1') {
  if ($banManager->isBanned($ip)) {
    $banManager->unbanIp($ip);
    $logMessage = t('Drush SOL unbanned @ip.', ['@ip' => $ip]);
    drush_log(dt($logMessage), 'ok');
    \Drupal::logger(dt($logMessage))->info( 'ok');
    \Drupal::logger('httpbl')->notice($logMessage);
  }
  else {
    drush_log(dt('@ip was not banned.', ['@ip' => $ip]), 'ok');
    \Drupal::logger(dt('@ip was not banned.', ['@ip' => $ip]))->info( 'ok');
  }

  // Get Evaluator service and delete this IP.
@@ -219,14 +219,14 @@ function drush_httpbl_sol($ip = '127.0.0.1') {
        // Rinse and repeat.
        $count --;
      }
    drush_log(dt('@ip was removed from evaluated hosts.', ['@ip' => $ip]), 'ok');
      \Drupal::logger(dt('@ip was removed from evaluated hosts.', ['@ip' => $ip]))->info( 'ok');
    }
    else {
      drush_log(dt('@ip was not an evaluated host.', ['@ip' => $ip]), 'ok');
      \Drupal::logger(dt('@ip was not an evaluated host.', ['@ip' => $ip]))->info( 'ok');
    }
  }
  else {
    drush_log(dt('@ip was not an evaluated host.', ['@ip' => $ip]), 'ok');
    \Drupal::logger(dt('@ip was not an evaluated host.', ['@ip' => $ip]))->info( 'ok');
  }

  return;
+7 −1
Changes for httpbl.info.yml: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,9 +2,15 @@ type: module
name: 'Http:BL'
description: 'Implements the http:BL blacklisting service from Project Honey Pot'
package: Spam control
core: 8.x
core_version_requirement: ^8.8 || ^9
# core: 8.x
configure: httpbl.admin_config
dependencies:
  - drupal:ban
tags:
 - spam

# Information added by Drupal.org packaging script on 2018-11-16
version: '8.x-1.x-dev'
project: 'httpbl'
datestamp: 1542400984
+1 −1
Changes for httpbl.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ function httpbl_requirements($phase) {
function httpbl_uninstall() {
  // Clean up any remaining variables (located in key_value table).
  // @todo Is this even needed anymore?  Find out.
  db_delete('key_value')
  \Drupal::database()->delete('key_value')
    ->condition('name', 'httpbl.%%', 'LIKE')
    ->execute();
}
+3 −4
Changes for httpbl.module: 3 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\httpbl\HostQuery;
use Drupal\httpbl\Entity\Host;
use Drupal\httpbl\HttpblResponse;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Form\FormStateInterface;

/**
@@ -143,7 +142,7 @@ function httpbl_comment_presave($comment) {
    if ($evaluated[1] > HTTPBL_LIST_SAFE ) {
      // Comment user's IP found in Project Honeypot.
      // Let them know.
      drupal_set_message(t('Your comment was rejected because your IP address (@ip) is ranked "suspicious" by Project Honeypot.', ['@ip' => $ip]), 'error', FALSE);
      \Drupal::messenger()->addMessage(t('Your comment was rejected because your IP address (@ip) is ranked "suspicious" by Project Honeypot.', ['@ip' => $ip]), 'error', FALSE);

      // Prepare to alter the comment subject and body.
      // Make link to the blocked host profile on Project Honeypot.
@@ -247,7 +246,7 @@ function httpbl_comment_presave($comment) {
          }

          // Advise commenter they are history!
          drupal_set_message(t('Your address (@ip) has been blacklisted for @time.', ['@ip' => $ip, '@time' => $expires]), 'error', FALSE);
          \Drupal::messenger()->addMessage(t('Your address (@ip) has been blacklisted for @time.', ['@ip' => $ip, '@time' => $expires]), 'error', FALSE);
        }

        // Check for blacklisting storage only (no auto-banning configured).
@@ -286,7 +285,7 @@ function httpbl_comment_presave($comment) {
          ]];
        $whitelistUrl->setOptions($whitelistUrl_options);
        $whitelistLink = Link::fromTextAndUrl(t('challenge'), $whitelistUrl)->toString();
        drupal_set_message(t('You can become white-listed for your current session by passing this @challenge.', ['@challenge' => $whitelistLink]), 'warning', FALSE);
        \Drupal::messenger()->addMessage(t('You can become white-listed for your current session by passing this @challenge.', ['@challenge' => $whitelistLink]), 'warning', FALSE);


        // Log this (greylisted) blocked comment.
Loading