You are here

function amazons3_update_7203 in AmazonS3 7.2

Convert all multiline string variables to arrays.

File

./amazons3.install, line 231
Install, update and uninstall functions for the AmazonS3 module.

Code

function amazons3_update_7203() {
  $variables = array(
    'amazons3_presigned_urls',
    'amazons3_rrs',
    'amazons3_saveas',
    'amazons3_torrents',
  );
  foreach ($variables as $name) {
    $value = variable_get($name, array());
    if (is_string($value)) {
      $value = explode("\n", $value);
      $value = array_map('trim', $value);
      $value = array_filter($value, 'strlen');
      variable_set($name, $value);
    }
  }
}