You are here

function seckit_update_6103 in Security Kit 6

Changes Content-Security-Policy "xhr-src" directive to "connect-src".

http://drupal.org/node/1241226#comment-5125336

File

./seckit.install, line 59
Install/uninstall actions for SecKit.

Code

function seckit_update_6103() {

  // update CSP directives
  // connect-src is used instead of xhr-src
  $options = variable_get('seckit_xss', array());

  // add connect-src
  $options['csp']['connect-src'] = $options['csp']['xhr-src'];

  // remove xhr-src
  unset($options['csp']['xhr-src']);

  // delete and set new version of variable
  variable_del('seckit_xss');
  variable_set('seckit_xss', $options);
}