Skip to content

Commit

Permalink
Fix c/s from Fabbot.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Quadling authored and Richard Quadling committed Oct 10, 2019
1 parent 27280b1 commit aa1294f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SensioLabs/AnsiConverter/AnsiToHtmlConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function convert($text)
// remove character set sequences
$text = \preg_replace('#\e(\(|\))(A|B|[0-2])#', '', $text);

$text = \htmlspecialchars($text, PHP_VERSION_ID >= 50400 ? ENT_QUOTES | ENT_SUBSTITUTE : ENT_QUOTES, $this->charset);
$text = \htmlspecialchars($text, \PHP_VERSION_ID >= 50400 ? ENT_QUOTES | ENT_SUBSTITUTE : ENT_QUOTES, $this->charset);

// carriage return
$text = \preg_replace('#^.*\r(?!\n)#m', '', $text);
Expand Down
6 changes: 3 additions & 3 deletions SensioLabs/AnsiConverter/Tests/AnsiToHtmlConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getConvertDataStandardTheme()
['<span style="background-color: black; color: white; text-decoration: underline">foo</span>', "\e[4mfoo\e[0m"],

// non valid unicode codepoints substitution (only available with PHP >= 5.4)
PHP_VERSION_ID < 50400 ? ['', ''] : ['<span style="background-color: black; color: white">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"],
\PHP_VERSION_ID < 50400 ? ['', ''] : ['<span style="background-color: black; color: white">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"],
];
}

Expand Down Expand Up @@ -108,7 +108,7 @@ public function getConvertDataWithSolarizedTheme()
['<span style="background-color: #073642; color: #eee8d5; text-decoration: underline">foo</span>', "\e[4mfoo\e[0m"],

// non valid unicode codepoints substitution (only available with PHP >= 5.4)
PHP_VERSION_ID < 50400 ? ['', ''] : ['<span style="background-color: #073642; color: #eee8d5">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"],
\PHP_VERSION_ID < 50400 ? ['', ''] : ['<span style="background-color: #073642; color: #eee8d5">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"],
];
}

Expand Down Expand Up @@ -141,7 +141,7 @@ public function getConvertDataWithSolarizedXTermTheme()
['<span style="background-color: #262626; color: #e4e4e4; text-decoration: underline">foo</span>', "\e[4mfoo\e[0m"],

// non valid unicode codepoints substitution (only available with PHP >= 5.4)
PHP_VERSION_ID < 50400 ? ['', ''] : ['<span style="background-color: #262626; color: #e4e4e4">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"],
\PHP_VERSION_ID < 50400 ? ['', ''] : ['<span style="background-color: #262626; color: #e4e4e4">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"],
];
}
}

0 comments on commit aa1294f

Please sign in to comment.