share: decode entities in metadata fields so that length limits would make more sense

This commit is contained in:
Andrew Dolgov 2019-03-19 15:53:32 +03:00
parent 9f52327b34
commit 74e8661351
1 changed files with 6 additions and 3 deletions

View File

@ -394,10 +394,13 @@ class Handler_Public extends Handler {
<link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">
<link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">";
$rv .= "<meta property=\"og:title\" content=\"".htmlspecialchars($line["title"])."\"/>\n";
$rv .= "<meta property=\"og:site_name\" content=\"".htmlspecialchars($line["feed_title"])."\"/>\n";
$rv .= "<meta property=\"og:title\" content=\"".htmlspecialchars(html_entity_decode($line["title"], ENT_NOQUOTES | ENT_HTML401))."\"/>\n";
//$rv .= "<meta property=\"og:site_name\" content=\"".htmlspecialchars($line["feed_title"])."\"/>\n";
$rv .= "<meta property=\"og:description\" content=\"".
htmlspecialchars(truncate_string(strip_tags($line["content"]), 500, "..."))."\"/>\n";
htmlspecialchars(
preg_replace("/[\r\n\t]/", "",
truncate_string(strip_tags(html_entity_decode($line["content"], ENT_NOQUOTES | ENT_HTML401)),
500, "...")))."\"/>\n";
$rv .= "</head>";