aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/feed/helper.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-12-27 01:19:16 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-12-27 01:33:54 +0530
commit657ddf8309ab86bd0db84e4fdddfe2b73f542d4b (patch)
treeb2093a42ea970052dd544a7ec947c1869169a415 /phpBB/phpbb/feed/helper.php
parentfd9366daf5a329abc91b173495efc8f94e4bd638 (diff)
downloadforums-657ddf8309ab86bd0db84e4fdddfe2b73f542d4b.tar
forums-657ddf8309ab86bd0db84e4fdddfe2b73f542d4b.tar.gz
forums-657ddf8309ab86bd0db84e4fdddfe2b73f542d4b.tar.bz2
forums-657ddf8309ab86bd0db84e4fdddfe2b73f542d4b.tar.xz
forums-657ddf8309ab86bd0db84e4fdddfe2b73f542d4b.zip
[ticket/11271] limit absolute path conversion to attachment links only
PHPBB3-11271
Diffstat (limited to 'phpBB/phpbb/feed/helper.php')
-rw-r--r--phpBB/phpbb/feed/helper.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php
index 1cc8cb221c..eebece00c4 100644
--- a/phpBB/phpbb/feed/helper.php
+++ b/phpBB/phpbb/feed/helper.php
@@ -142,7 +142,12 @@ class helper
{
$update_count = array();
parse_attachments($forum_id, $content, $post_attachments, $update_count);
- $content .= implode('<br />', $post_attachments);
+ $post_attachments = implode('<br />', $post_attachments);
+
+ // Convert attachments' relative path to absolute path
+ $post_attachments = str_replace($this->phpbb_root_path . 'download', $this->get_board_url() . '/download', $post_attachments);
+
+ $content .= $post_attachments;
}
// Remove Comments from inline attachments [ia]
@@ -164,9 +169,6 @@ class helper
// Other control characters
$content = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $content);
- // Convert attachments' relative path to absolute path
- $content = str_replace($this->phpbb_root_path . 'download', $this->get_board_url() . '/download', $content);
-
return $content;
}
}