mirror of
https://github.com/friendica/friendica
synced 2024-12-23 05:20:15 +00:00
Merge pull request #3106 from rabuzarus/20170125_-_meta_description
limit the description of the meta tag to 160 characters in /mod/display
This commit is contained in:
commit
b17f032b6a
1 changed files with 6 additions and 0 deletions
|
@ -425,6 +425,12 @@ function display_content(App $a, $update = 0) {
|
||||||
if ($title == "") {
|
if ($title == "") {
|
||||||
$title = $author_name;
|
$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
|
$description = htmlspecialchars($description, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
|
||||||
$title = htmlspecialchars($title, 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
|
$author_name = htmlspecialchars($author_name, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
|
||||||
|
|
Loading…
Reference in a new issue