aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-11-08 16:19:08 +0100
committerMax Kostikov <max@kostikov.co>2019-11-08 16:19:08 +0100
commit3706afbd01164c9f322c605d6ec242e6ca4770fa (patch)
tree9058e3c125384ad6c2cd465fc6dc778d1143fa4e
parent426668cd2ea1ffbf1bd7751f604755255a20d305 (diff)
downloadvolse-hubzilla-3706afbd01164c9f322c605d6ec242e6ca4770fa.tar.gz
volse-hubzilla-3706afbd01164c9f322c605d6ec242e6ca4770fa.tar.bz2
volse-hubzilla-3706afbd01164c9f322c605d6ec242e6ca4770fa.zip
Do not trim a sufficiently shortened Opengraph description
-rw-r--r--include/opengraph.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/opengraph.php b/include/opengraph.php
index ba97d4f4f..9de021d54 100644
--- a/include/opengraph.php
+++ b/include/opengraph.php
@@ -43,7 +43,7 @@
$ogdesc = str_replace("\n", " ", $ogdesc);
while (strpos($ogdesc, " ") !== false)
$ogdesc = str_replace(" ", " ", $ogdesc);
- $ogdesc = rtrim(substr($ogdesc, 0, strrpos($ogdesc, " ")), "?.,:;!-") . "...";
+ $ogdesc = (strlen($ogdesc) < 298 ? $ogdesc : rtrim(substr($ogdesc, 0, strrpos($ogdesc, " ")), "?.,:;!-") . "...");
$ogtype = "article";
}