diff options
author | Dhruv <dhruv.goel92@gmail.com> | 2013-10-05 16:54:09 +0530 |
---|---|---|
committer | Dhruv <dhruv.goel92@gmail.com> | 2013-10-05 16:54:09 +0530 |
commit | 7a971f896d9a09037959d26794b8efe09aa1258e (patch) | |
tree | 6ffccdcc3270368b8b56982c4f50beb7e4b9596d /phpBB/phpbb/feed/helper.php | |
parent | e8c7f8134df38708e1af27325d2c8a7b9f28052e (diff) | |
parent | c73801242d5c1abc3efb4ac75b4cc1a5d01ce514 (diff) | |
download | forums-7a971f896d9a09037959d26794b8efe09aa1258e.tar forums-7a971f896d9a09037959d26794b8efe09aa1258e.tar.gz forums-7a971f896d9a09037959d26794b8efe09aa1258e.tar.bz2 forums-7a971f896d9a09037959d26794b8efe09aa1258e.tar.xz forums-7a971f896d9a09037959d26794b8efe09aa1258e.zip |
Merge branch 'ticket/11271' into ticket/11271-develop
# By erangamapa (7) and Dhruv (2)
* ticket/11271:
[ticket/11271] Typecast forum and topic id to integer
[ticket/11271] Use absolute path for displaying inline attachments in feeds
[ticket/11271] Changed executable bit.
[ticket/11271] Formatting code and removing null assignment.
[ticket/11271] Removing unnecessary database object
[ticket/11271] Separated attachment fetching query
[ticket/11271] Fetched feed attachments before loop.
[ticket/11271] Removed in-line attachment comments properly.
[ticket/11271] Displaying in-line attached images in ATOM feed.
Conflicts:
phpBB/feed.php
Diffstat (limited to 'phpBB/phpbb/feed/helper.php')
-rw-r--r-- | phpBB/phpbb/feed/helper.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php index cf8328bd5e..88eb64953c 100644 --- a/phpBB/phpbb/feed/helper.php +++ b/phpBB/phpbb/feed/helper.php @@ -90,7 +90,7 @@ class helper /** * Generate text content */ - public function generate_content($content, $uid, $bitfield, $options) + public function generate_content($content, $uid, $bitfield, $options, $forum_id, $post_attachments) { if (empty($content)) { @@ -137,8 +137,15 @@ class helper // Remove some specials html tag, because somewhere there are a mod to allow html tags ;) $content = preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' <strong>$1</strong> ', $content); + // Parse inline images to display with the feed + if (count($post_attachments) > 0) + { + $update_count = array(); + parse_attachments($forum_id, $content, $post_attachments, $update_count); + } + // Remove Comments from inline attachments [ia] - $content = preg_replace('#<div class="(inline-attachment|attachtitle)">(.*?)<!-- ia(.*?) -->(.*?)<!-- ia(.*?) -->(.*?)</div>#si','$4',$content); + $content = preg_replace('#<dd>(.*?)</dd>#','',$content); // Replace some entities with their unicode counterpart $entities = array( @@ -156,6 +163,9 @@ 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; } } |