diff options
author | Max Kostikov <max@kostikov.co> | 2019-11-08 16:19:08 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-11-08 16:19:08 +0100 |
commit | 3706afbd01164c9f322c605d6ec242e6ca4770fa (patch) | |
tree | 9058e3c125384ad6c2cd465fc6dc778d1143fa4e | |
parent | 426668cd2ea1ffbf1bd7751f604755255a20d305 (diff) | |
download | volse-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.php | 2 |
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"; } |