Skip to content

Commit 2415bf8

Browse files
committed
Sync string escapes with GB PR
1 parent 9940a5b commit 2415bf8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/wp-includes/css-api/class-wp-css-token-processor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,7 @@ private function create_css_string( string $value ): string {
856856
$escaped = strtr(
857857
$value,
858858
array(
859+
// Escape existing backslashes to prevent unintentional escapes in result.
859860
'\\' => '\\5C ',
860861

861862
// Pre-processing replaces NULLs and some newlines. Replace and escape as necessary.
@@ -869,6 +870,8 @@ private function create_css_string( string $value ): string {
869870
// Newlines must be escaped in CSS strings.
870871
"\n" => '\\A ',
871872

873+
// Arbitrary characters for Unicode escaping:
874+
872875
// HTML syntax may be problematic.
873876
'<' => '\\3C ',
874877
'>' => '\\3E ',

0 commit comments

Comments
 (0)