File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 $ dumpLocationOptions = usingPhpSyncTool ($ dbSyncTool ) ? '' : "-kd $ dbDumpDir -dn $ dbDumpFilename " ;
2727
2828 $ dbSyncToolConfigPath = get ('dev_db_sync_tool_config_path ' );
29- runLocally (" $ dbSyncTool -f $ dbSyncToolConfigPath/ $ dbSyncToolSync -y $ dumpLocationOptions $ additionalOptions " , ['real_time_output ' => true ]);
29+ runLocally (escapeshellarg ( $ dbSyncTool) . " -f $ dbSyncToolConfigPath/ $ dbSyncToolSync -y $ dumpLocationOptions $ additionalOptions " , ['real_time_output ' => true ]);
3030})
3131 ->desc ('Sync database with drush ' );
Original file line number Diff line number Diff line change 1111 $ dbSyncTool = requireSyncTool ('import ' );
1212
1313 $ dbSyncToolConfigPath = get ('dev_db_sync_tool_config_path ' );
14- runLocally (" $ dbSyncTool -f $ dbSyncToolConfigPath/ $ dbSyncToolSync -y -i $ dbDumpDir/ $ dbDumpFilename.sql " , ['real_time_output ' => true ]);
14+ runLocally (escapeshellarg ( $ dbSyncTool) . " -f $ dbSyncToolConfigPath/ $ dbSyncToolSync -y -i $ dbDumpDir/ $ dbDumpFilename.sql " , ['real_time_output ' => true ]);
1515})
1616 ->desc ('Sync database with drush ' );
Original file line number Diff line number Diff line change 5050 $ dbSyncTool = requireSyncTool ('sync ' );
5151
5252 $ dbSyncToolConfigPath = get ('dev_db_sync_tool_config_path ' );
53- runLocally (" $ dbSyncTool -f $ dbSyncToolConfigPath/ $ dbSyncToolSync -y $ additionalOptions " , ['real_time_output ' => true ]);
53+ runLocally (escapeshellarg ( $ dbSyncTool) . " -f $ dbSyncToolConfigPath/ $ dbSyncToolSync -y $ additionalOptions " , ['real_time_output ' => true ]);
5454 info ("💽 Database from $ target synced successfully " );
5555})
5656 ->desc ('Sync database with db-sync-tool ' );
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ function resolveDatabaseHostToIp(string $hostname): void
133133 // php-sync-tool has file sync integrated, no separate file_sync_tool call needed
134134 $ withFiles = $ isPhpSyncTool && false !== get ('file_sync_tool ' ) ? '--with-files ' : '' ;
135135 info ('Synching database ' );
136- runLocally (" $ dbSyncTool -f {{feature_sync_config}} --target-path {{feature_sync_target_path}} $ useRsync $ withFiles -y $ optionalVerbose " );
136+ runLocally (escapeshellarg ( $ dbSyncTool) . " -f {{feature_sync_config}} --target-path {{feature_sync_target_path}} $ useRsync $ withFiles -y $ optionalVerbose " );
137137 $ synced = true ;
138138 } else {
139139 debug ("Skipping database sync, command \” $ dbSyncTool\” not available " );
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ function commandExistLocally(string $command): bool
138138 */
139139function isExecutableLocally (string $ path ): bool
140140{
141- return testLocally (" [ -x $ path ] " );
141+ return testLocally (' [ -x ' . escapeshellarg ( $ path) . ' ] ' );
142142}
143143
144144/**
Original file line number Diff line number Diff line change 1616 if (syncToolAvailableLocally ($ dbSyncTool )) {
1717 $ useRsync = usingPhpSyncTool ($ dbSyncTool ) ? '' : '--use-rsync ' ;
1818 info ('Generating a database backup ' );
19- runLocally (" $ dbSyncTool -f {{sync_database_backup_config}} $ useRsync -y $ optionalVerbose " );
19+ runLocally (escapeshellarg ( $ dbSyncTool) . " -f {{sync_database_backup_config}} $ useRsync -y $ optionalVerbose " );
2020 } else {
2121 debug ("Skipping database backup, $ dbSyncTool not available " );
2222 }
You can’t perform that action at this time.
0 commit comments