Skip to content

Commit

Permalink
drush-ops#3163: don't use STDOUT as a function parameter default, bec…
Browse files Browse the repository at this point in the history
…ause the define actually calls fopen()
  • Loading branch information
douggreen committed Nov 15, 2017
1 parent 9bcb79f commit 64205e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/output.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ use Drush\Log\LogLevel;
* @param $newline
* Add a "\n" to the end of the output. Defaults to TRUE.
*/
function drush_print($message = '', $indent = 0, $handle = STDOUT, $newline = TRUE) {
function drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE) {
$msg = str_repeat(' ', $indent) . (string)$message;
if ($newline) {
$msg .= "\n";
}
if (($charset = drush_get_option('output_charset')) && function_exists('iconv')) {
$msg = iconv('UTF-8', $charset, $msg);
}
if (!$handle) {
$handle = STDOUT;
}
fwrite($handle, $msg);
}

Expand Down

0 comments on commit 64205e9

Please sign in to comment.