Commit 4d42759d authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #120 from TBSliver/TBSliver/WP-Cli-Mkdir-Fix

CRM-21565: Change mkdir to use correct and more secure mode numbers
parents ed8737f2 75caf456
......@@ -379,7 +379,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
$upload_dir = wp_upload_dir();
$settings_dir = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR;
civicrm_setup( $upload_dir['basedir'] . DIRECTORY_SEPARATOR );
WP_CLI::launch( "chmod 0777 $settings_dir -R" );
WP_CLI::launch( "chmod 0755 $settings_dir -R" );
# now we've got some files in place, require PEAR DB and check db setup
$dsn = "mysql://{$dbuser}:{$dbpass}@{$dbhost}/{$dbname}?new_link=true";
......@@ -654,7 +654,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
$restore_backup_dir .= '/plugins/restore/' . $date;
if ( ! mkdir( $restore_backup_dir, 777, true ) ) {
if ( ! mkdir( $restore_backup_dir, 0755, true ) ) {
return WP_CLI::error( 'Failed creating directory: ' . $restore_backup_dir );
}
......@@ -999,7 +999,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
# begin upgrade
$backup_dir .= '/plugins/' . $date;
if ( ! mkdir( $backup_dir, 777, true ) ) {
if ( ! mkdir( $backup_dir, 0755, true ) ) {
return WP_CLI::error( 'Failed creating directory: ' . $backup_dir );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment