You are here

function backup_migrate_destination_files::dir_in_webroot in Backup and Migrate 8.2

Same name and namespace in other branches
  1. 8.3 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 230
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) {
  if (strpos(drupal_realpath($directory), realpath($_SERVER['DOCUMENT_ROOT'])) !== FALSE) {
    return TRUE;
  }
  return FALSE;
}