]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/makefulltextfeed.php
Merge pull request #1018 from shtrom/fix-share-email-body-dev
[github/wallabag/wallabag.git] / inc / 3rdparty / makefulltextfeed.php
index 62c050ec2bc368fd63fd265da8bfa1b888453782..27a62d7324890d474dea4cead9bc5c451c45ec32 100755 (executable)
@@ -31,6 +31,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //error_reporting(E_ALL ^ E_NOTICE);\r
 ini_set("display_errors", 1);\r
 @set_time_limit(120);\r
+libxml_use_internal_errors(true); \r
+\r
 \r
 // Deal with magic quotes\r
 if (get_magic_quotes_gpc()) {\r
@@ -671,7 +673,11 @@ foreach ($items as $key => $item) {
                        $html .= $item->get_description();\r
                } else {\r
                        $readability->clean($content_block, 'select');\r
-                       if ($options->rewrite_relative_urls) makeAbsolute($effective_url, $content_block);\r
+                       // get base URL\r
+                       $base_url = get_base_url($readability->dom);\r
+                       if (!$base_url) $base_url = $effective_url;\r
+                       // rewrite URLs\r
+                       if ($options->rewrite_relative_urls) makeAbsolute($base_url, $content_block);\r
                        // footnotes\r
                        if (($links == 'footnotes') && (strpos($effective_url, 'wikipedia.org') === false)) {\r
                                $readability->addFootnotes($content_block);\r