summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-06-10 09:18:39 +0300
committerAndrew Dolgov <[email protected]>2023-06-10 09:18:39 +0300
commit63f4ea5f5be426810077acf49967a140053c266d (patch)
tree544e484abc2c0fef9abaa8514da95a817302b25b /init.php
parent9a92931e9be0bacdcc8a026c79dbf1f4185266a5 (diff)
append when invoking readability
Diffstat (limited to 'init.php')
-rw-r--r--init.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/init.php b/init.php
index 3cfde14..f6ba6e3 100644
--- a/init.php
+++ b/init.php
@@ -380,7 +380,7 @@ class Af_Lemmy extends Plugin {
*/
private function readability(array $article, string $url, DOMDocument $doc, DOMXpath $xpath, bool $debug = false) : array {
- if (function_exists("curl_init") && mb_strlen(strip_tags($article["content"])) <= 150) {
+ if (function_exists("curl_init") && !preg_match("/post\/[0-9]{1,}$/", $url) && mb_strlen(strip_tags($article["content"])) <= 200) {
/* link may lead to a huge video file or whatever, we need to check content type before trying to
parse it which p much requires curl */
@@ -393,7 +393,7 @@ class Af_Lemmy extends Plugin {
$this->host->run_hooks_callback(PluginHost::HOOK_GET_FULL_TEXT,
function ($result) use (&$article) {
if ($result) {
- $article["content"] = $result;
+ $article["content"] .= "<hr/>" . $result;
return true;
}
},