You are here

function path2ban_update_7101 in path2ban 7

Same name and namespace in other branches
  1. 7.2 path2ban.install \path2ban_update_7101()

Implements hook_update_N

File

./path2ban.install, line 47
Install, update and uninstall functions for the path2ban module.

Code

function path2ban_update_7101() {

  // Add paths to prevent attacks encountered during Drupalgeddon 2.
  $list = variable_get('path2ban_list', path2ban_get_default_paths_to_ban());
  $list = $list . "\n";
  $entries_to_add = array(
    'payload.php',
    'so.php',
    'formas.php',
    'aul.php',
    'rxr.php',
    'wp-caches.php',
    'sec.php',
    'alpha.php',
    'u.php',
    'searchreplacedb2.php',
    'd7.php',
    '_.php',
    'pplugins.php',
    '*.sql',
    '*.swf',
    '*config.php',
    '*.wsf',
    '*.ssh',
  );

  // Check that the user hasn't already added them before adding.
  foreach ($entries_to_add as $each_entry_to_add) {
    if (NULL === strpos($list, $each_entry_to_add)) {
      $list .= $each_entry_to_add . "\n";
    }
  }
  variable_set('path2ban_list', $list);
}