Skip to content

Commit

Permalink
[TASK] Drop replacement of unicode non breaking spaces
Browse files Browse the repository at this point in the history
ext-mbstring is not always available, and
symfony/polyfill-mbstring doesn't provide mb_split,
therefore this nice-to-have (which isn't required
from a security perspective) is dropped for now.
  • Loading branch information
bnf authored and ohader committed Jul 25, 2023
1 parent e3026f5 commit a35f220
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Serializer/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ protected function enc($text, $attribute = false): string
// we rather want to treat it as pure text, that is *always* to be encoded.
true
);
// htmlspecialchars does escaping, but it doesn't match the requirements of
// HTML5 section 8.3 to ecape non breaking spaces
// https://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#escapingString
$value = implode(' ', mb_split("\xc2\xa0", $value));
return $value;
}
return parent::enc($text, $attribute);
Expand Down

0 comments on commit a35f220

Please sign in to comment.