Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Be careful not to alter non-string values when doing tilde expansion.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 17, 2015
1 parent 3c7761b commit bb02dc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/preflight.inc
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,11 @@ function drush_preflight_tilde_expansion(&$command) {
$match = '#^~/#';
$replacement = drush_server_home() . '/';
foreach ($cli as $key => $value) {
if (preg_match($match, $value)) {
if (is_string($value) && preg_match($match, $value)) {
$cli[$key] = preg_replace($match, $replacement, $value);
}
}
$command['arguments'] = array_map(function($value) use($match, $replacement) { return preg_replace($match, $replacement, $value); } , $command['arguments']);
$command['arguments'] = array_map(function($value) use($match, $replacement) { return is_string($value) ? preg_replace($match, $replacement, $value) : $value; } , $command['arguments']);
}
}

Expand Down

0 comments on commit bb02dc0

Please sign in to comment.