mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX HTMLText->LimitCharacters() to use UTF8 compatible htmlentities() and html_entity_decode() calls
This commit is contained in:
parent
09283fba88
commit
2667fc6ef0
@ -29,11 +29,11 @@ class HTMLText extends Text {
|
||||
// Content html text to plan text before sub string-ing
|
||||
// to cutting off part of the html entity character
|
||||
// For example, & because &am
|
||||
$value = html_entity_decode($value);
|
||||
$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');
|
||||
$value = (strlen($value) > $limit) ? substr($value, 0, $limit) . $add : $value;
|
||||
|
||||
// Convert plan text back to html entities
|
||||
$value = htmlentities($value);
|
||||
$value = htmlentities($value, ENT_COMPAT, 'UTF-8');
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user