8000 Fixed the escaping of back slashes and << in console output by javiereguiluz · Pull Request #23730 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fixed the escaping of back slashes and << in console output #23730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed a silly error to really use the null character
  • Loading branch information
javiereguiluz committed Aug 28, 2017
commit 2c83766ec95519ae3011af17ab1858c9b2075aa0
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Formatter/OutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function escapeTrailingBackslash($text)
if ('\\' === substr($text, -1)) {
$len = strlen($text);
$text = rtrim($text, '\\');
$text .= str_repeat('\0', $len - strlen($text));
$text .= str_repeat("\0", $len - strlen($text));
}

return $text;
Expand Down Expand Up @@ -165,8 +165,8 @@ public function format($message)

$output .= $this->applyCurrentStyle(substr($message, $offset));

if (false !== strpos($output, '\0')) {
return strtr($output, array('\0' => '\\', '\\<' => '<'));
if (false !== strpos($output, "\0")) {
return strtr($output, array("\0" => '\\', '\\<' => '<'));
}

return str_replace('\\<', '<', $output);
Expand Down
0