You are here

function backup_migrate_destination_files::dir_in_webroot in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.file.inc \backup_migrate_destination_files::dir_in_webroot()
  2. 6.3 includes/destinations.file.inc \backup_migrate_destination_files::dir_in_webroot()
  3. 6.2 includes/destinations.file.inc \backup_migrate_destination_files::dir_in_webroot()
  4. 7.3 includes/destinations.file.inc \backup_migrate_destination_files::dir_in_webroot()
  5. 7.2 includes/destinations.file.inc \backup_migrate_destination_files::dir_in_webroot()

Check if the given directory is within the webroot and is therefore web accessible.

1 call to backup_migrate_destination_files::dir_in_webroot()
backup_migrate_destination_files::check_dir in includes/destinations.file.inc
Prepare the destination directory for the backups.

File

includes/destinations.file.inc, line 268
A destination type for saving locally to the server.

Class

backup_migrate_destination_files
A destination type for saving locally to the server.

Code

function dir_in_webroot($directory) {
  $real_dir = drupal_realpath($directory);
  $real_root = drupal_realpath(DRUPAL_ROOT);
  if ($real_dir == $real_root || strpos($real_dir, $real_root . '/') === 0) {
    return TRUE;
  }
  return FALSE;
}