From e2f72539e101906d9427963f2f92893e4a39b029 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 25 Dec 2013 03:54:59 +0530 Subject: [ticket/11271] Use class variable $db instead of global PHPBB3-11271 --- phpBB/phpbb/feed/post_base.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index b126ad0e4a..fa59a5022e 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -60,8 +60,6 @@ abstract class post_base extends \phpbb\feed\base function fetch_attachments() { - global $db; - $sql_array = array( 'SELECT' => 'a.*', 'FROM' => array( @@ -86,14 +84,14 @@ abstract class post_base extends \phpbb\feed\base $sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id; } - $sql = $db->sql_build_query('SELECT', $sql_array); - $result = $db->sql_query($sql); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query($sql); // Set attachments in feed items - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $this->attachments[$row['post_msg_id']][] = $row; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); } } -- cgit v1.2.1 From 1bb175ce7759e937494f74769b334a9acf3779d2 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 25 Dec 2013 04:45:22 +0530 Subject: [ticket/11271] Add the inline images html to content PHPBB3-11271 --- phpBB/phpbb/feed/helper.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php index 88eb64953c..7527969b55 100644 --- a/phpBB/phpbb/feed/helper.php +++ b/phpBB/phpbb/feed/helper.php @@ -142,6 +142,7 @@ class helper { $update_count = array(); parse_attachments($forum_id, $content, $post_attachments, $update_count); + $content .= implode('
', $post_attachments); } // Remove Comments from inline attachments [ia] -- cgit v1.2.1 From 657ddf8309ab86bd0db84e4fdddfe2b73f542d4b Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 27 Dec 2013 01:19:16 +0530 Subject: [ticket/11271] limit absolute path conversion to attachment links only PHPBB3-11271 --- phpBB/phpbb/feed/helper.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb') 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('
', $post_attachments); + $post_attachments = implode('
', $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; } } -- cgit v1.2.1