浏览代码

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

tags/3.5.1
rabuzarus 3 年前
父节点
当前提交
4c8de5fcfd
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      mod/display.php

+ 6
- 0
mod/display.php 查看文件

@@ -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


正在加载...
取消
保存