]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/makefulltextfeed.php
Implemented additional check for using the 'X-Forwarded-Port' header.
[github/wallabag/wallabag.git] / inc / 3rdparty / makefulltextfeed.php
index 7a56be8c7c967cec629d0129feb3bb72d4ee8249..a081f88b29f6800dab4cd2249366e35d45cd33dd 100755 (executable)
@@ -28,7 +28,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 // Request this file passing it a web page or feed URL in the querystring: makefulltextfeed.php?url=example.org/article\r
 // For more request parameters, see http://help.fivefilters.org/customer/portal/articles/226660-usage\r
 \r
-error_reporting(E_ALL ^ E_NOTICE);\r
+//error_reporting(E_ALL ^ E_NOTICE);\r
 ini_set("display_errors", 1);\r
 @set_time_limit(120);\r
 \r
@@ -671,7 +671,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