summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-03-19 15:53:32 +0300
committerAndrew Dolgov <[email protected]>2019-03-19 15:53:32 +0300
commit74e86613519348206ee0acd1bad23d9dfc3d9f89 (patch)
tree92c2be51e880e7001ca14b7a5f67d3967782db93 /classes
parent9f52327b34b324c3ad052a1c2751d860862ffcc7 (diff)
share: decode entities in metadata fields so that length limits would make more sense
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/handler/public.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index 9c6a94c12..15d150619 100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -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>";