summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhelmo2017-05-25 13:40:54 (GMT)
committerHerman van Rink2017-05-25 13:40:54 (GMT)
commit0181a43c417c957de92d6c801161a9b43c951169 (patch)
treebcf7f98ec9a0e459288754c04b645936fe154a5a
parent9550a23aa17254ed17ab9dc8ea30d99a3447e936 (diff)
Issue #2871578 by helmo: Catch relative backup name passed to provision-delete
-rw-r--r--platform/delete.provision.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/delete.provision.inc b/platform/delete.provision.inc
index 9937b62..efedd52 100644
--- a/platform/delete.provision.inc
+++ b/platform/delete.provision.inc
@@ -6,8 +6,13 @@
function drush_provision_drupal_pre_provision_delete($backup_file = NULL) {
if (d()->type === 'site') {
drush_set_option('force', true, 'process');
- drush_invoke("provision-backup", $backup_file);
- drush_unset_option('force', 'process');
+ if (!empty($backup_file) && !strpos($backup_file, '/')) {
+ drush_set_error('PROVISION_DELETE_BACKUP_NAME_RELATIVE', dt('The passed backup name is a relative path, storing that in the site directory which is going to be deleted is probably not intended. Try an absolute name, or no name to let one be generated.'));
+ }
+ else {
+ drush_invoke("provision-backup", $backup_file);
+ drush_unset_option('force', 'process');
+ }
}
}