limit the description of the meta tag to 160 characters in /mod/display

Cette révision appartient à :
rabuzarus 2017-01-25 13:10:42 +01:00
Parent b9ff10cda4
révision 4c8de5fcfd
1 fichiers modifiés avec 6 ajouts et 0 suppressions

Voir le fichier

@ -425,6 +425,12 @@ function display_content(App $a, $update = 0) {
if ($title == "") {
$title = $author_name;
}
// Limit the description to 160 characters
if (strlen($description) > 160) {
$description = substr($description, 0, 157) . '...';
}
$description = htmlspecialchars($description, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
$title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
$author_name = htmlspecialchars($author_name, ENT_COMPAT, 'UTF-8', true); // allow double encoding here