You are here

function _backup_migrate_filename_append_prepare in Backup and Migrate 8.2

Same name and namespace in other branches
  1. 8.3 includes/files.inc \_backup_migrate_filename_append_prepare()
  2. 6.3 includes/files.inc \_backup_migrate_filename_append_prepare()
  3. 6.2 includes/files.inc \_backup_migrate_filename_append_prepare()
  4. 7.3 includes/files.inc \_backup_migrate_filename_append_prepare()
  5. 7.2 includes/files.inc \_backup_migrate_filename_append_prepare()

Adjust the length of a filename to allow for a string to be appended, staying within the maximum filename limit.

1 call to _backup_migrate_filename_append_prepare()
_backup_migrate_construct_filename in includes/files.inc
Construct a filename using token and some cleaning.

File

includes/files.inc, line 70
General file handling code for Backup and Migrate.

Code

function _backup_migrate_filename_append_prepare($filename, $append_str) {
  $max_name_len = BACKUP_MIGRATE_FILENAME_MAXLENGTH - drupal_strlen($append_str);
  if (drupal_strlen($filename) > $max_name_len) {
    $filename = drupal_substr($filename, 0, $max_name_len);
  }
  return $filename;
}