From 23f1b7d9c7228746008a215ff944adf13f54251d Mon Sep 17 00:00:00 2001 From: CarstenF Date: Wed, 15 Jul 2015 19:39:54 +0200 Subject: [PATCH 1/2] [ticket/13988] Use absolute path for image attachments in feeds Previously, atom feeds use relative links for image attachments PHPBB3-13988 --- phpBB/phpbb/feed/helper.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php index 198134cdcf..f2030f5ced 100644 --- a/phpBB/phpbb/feed/helper.php +++ b/phpBB/phpbb/feed/helper.php @@ -149,12 +149,10 @@ class helper { $update_count = array(); parse_attachments($forum_id, $content, $post_attachments, $update_count); - $post_attachments = implode('
', $post_attachments); + $content .= implode('
', $post_attachments); // Convert attachments' relative path to absolute path - $post_attachments = str_replace($this->phpbb_root_path . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $post_attachments); - - $content .= $post_attachments; + $content = str_replace($this->phpbb_root_path . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $content); } // Remove Comments from inline attachments [ia] From 7e1b0330a3ddd269c85047912c956daf930018cc Mon Sep 17 00:00:00 2001 From: Zoddo Date: Wed, 15 Jul 2015 21:55:12 +0200 Subject: [PATCH 2/2] [ticket/13988] Update tests PHPBB3-13988 --- tests/functional/feed_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index 9041c8dc69..ad5c4a5cab 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -1395,7 +1395,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case foreach ($attachments as $i => $attachment) { $content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text(); - $url = "./download/file.php?id={$attachment['id']}"; + $url = self::$root_url . "download/file.php?id={$attachment['id']}"; $string = "Attachment #{$i}"; if ($attachment['displayed'])