]> git.wh0rd.org Git - tt-rss.git/commitdiff
create_published_article: only use readability if enabled in the plugin
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Fri, 29 Jan 2016 12:48:44 +0000 (15:48 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Fri, 29 Jan 2016 12:48:44 +0000 (15:48 +0300)
classes/article.php

index e47da86173c5700bb7140baa3e1ba06fe7943ce3..9a7c687074c930a39a23533ce824a5886c2cbc38 100644 (file)
@@ -92,13 +92,18 @@ class Article extends Handler_Protected {
                if (!$content) {
                        $pluginhost = new PluginHost();
                        $pluginhost->load_all(PluginHost::KIND_ALL, $owner_uid);
+                       $pluginhost->load_data();
 
                        $af_readability = $pluginhost->get_plugin("Af_Readability");
 
                        if ($af_readability) {
-                               $extracted_content = $af_readability->extract_content($url);
+                               $enable_share_anything = $pluginhost->get($af_readability, "enable_share_anything");
 
-                               if ($extracted_content) $content = db_escape_string($extracted_content);
+                               if ($enable_share_anything) {
+                                       $extracted_content = $af_readability->extract_content($url);
+
+                                       if ($extracted_content) $content = db_escape_string($extracted_content);
+                               }
                        }
                }