You are here

function _backup_migrate_filename_append_prepare in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 8.2 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.

2 calls to _backup_migrate_filename_append_prepare()
backup_file::filename in includes/files.inc
Get the final filename.
_backup_migrate_construct_filename in includes/files.inc
Construct a filename using token and some cleaning.

File

includes/files.inc, line 132
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;
}