X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2F3rdparty%2Fmakefulltextfeed.php;h=27a62d7324890d474dea4cead9bc5c451c45ec32;hb=ddbb2308a3302e2d2d6ff89f4dd3235f85d335e1;hp=7a56be8c7c967cec629d0129feb3bb72d4ee8249;hpb=a9f5e572dde4f986a498d2fbe92a38a1b22f9595;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/3rdparty/makefulltextfeed.php b/inc/3rdparty/makefulltextfeed.php index 7a56be8c..27a62d73 100755 --- a/inc/3rdparty/makefulltextfeed.php +++ b/inc/3rdparty/makefulltextfeed.php @@ -28,9 +28,11 @@ along with this program. If not, see . // Request this file passing it a web page or feed URL in the querystring: makefulltextfeed.php?url=example.org/article // For more request parameters, see http://help.fivefilters.org/customer/portal/articles/226660-usage -error_reporting(E_ALL ^ E_NOTICE); +//error_reporting(E_ALL ^ E_NOTICE); ini_set("display_errors", 1); @set_time_limit(120); +libxml_use_internal_errors(true); + // Deal with magic quotes if (get_magic_quotes_gpc()) { @@ -671,7 +673,11 @@ foreach ($items as $key => $item) { $html .= $item->get_description(); } else { $readability->clean($content_block, 'select'); - if ($options->rewrite_relative_urls) makeAbsolute($effective_url, $content_block); + // get base URL + $base_url = get_base_url($readability->dom); + if (!$base_url) $base_url = $effective_url; + // rewrite URLs + if ($options->rewrite_relative_urls) makeAbsolute($base_url, $content_block); // footnotes if (($links == 'footnotes') && (strpos($effective_url, 'wikipedia.org') === false)) { $readability->addFootnotes($content_block);