Index: feed.php =================================================================== --- feed.php (revision 10200) +++ feed.php (working copy) @@ -71,7 +71,7 @@ // FEED_IMAGE is not used (atom) $global_vars = array( 'FEED_IMAGE' => ($user->img('site_logo', '', false, '', 'src')) ? $board_url . '/' . substr($user->img('site_logo', '', false, '', 'src'), strlen($phpbb_root_path)) : '', - 'SELF_LINK' => feed_append_sid('/feed.' . $phpEx, $params), + 'SELF_LINK' => append_sid("{$board_url}/feed.{$phpEx}", $params, true, ''), 'FEED_LINK' => $board_url . '/index.' . $phpEx, 'FEED_TITLE' => $config['sitename'], 'FEED_SUBTITLE' => $config['site_desc'], @@ -206,26 +206,6 @@ exit_handler(); /** -* Run links through append_sid(), prepend generate_board_url() and remove session id -**/ -function feed_append_sid($url, $params) -{ - global $board_url; - - $link = append_sid($board_url . $url, $params); - - // Remove added sid - not as easy as it sounds. ;) - $link = (strpos($link, 'sid=') !== false) ? trim(preg_replace('/(&|&|\?)sid=[a-z0-9]+(&|&)?/', '\1', $link), '?& ') : $link; - - // Now the only thing remaining could be an empty & - $link = (substr($link, -5) === '&') ? substr($link, 0, -5) : $link; - // And &#xxx - $link = str_replace('&#', '#', $link); - - return $link; -} - -/** * Generate text content **/ function feed_generate_content($content, $uid, $bitfield, $options) @@ -797,16 +777,16 @@ function adjust_item(&$item_row, &$row) { - global $phpEx, $config; + global $board_url, $phpEx, $config; $item_row['title'] = (!$this->topic_id) ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; - $item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, "t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}"); + $item_row['link'] = append_sid("{$board_url}/viewtopic.{$phpEx}", "t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}", true, ''); if ($config['feed_item_statistics']) { global $user; - $user_link = '' . $row['username'] . ''; + $user_link = '' . $row['username'] . ''; $time = ($this->topic_id) ? $row['post_time'] : $row['topic_time']; @@ -858,9 +838,9 @@ function adjust_item(&$item_row, &$row) { - global $phpEx, $config; + global $board_url, $phpEx, $config; - $item_row['link'] = feed_append_sid('/viewforum.' . $phpEx, 'f=' . $row['forum_id']); + $item_row['link'] = append_sid("{$board_url}/viewforum.{$phpEx}", 'f=' . $row['forum_id'], true, ''); if ($config['feed_item_statistics']) { @@ -947,15 +927,15 @@ function adjust_item(&$item_row, &$row) { - global $phpEx, $config; + global $board_url, $phpEx, $config; - $item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, 't=' . $row['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id']); + $item_row['link'] = append_sid("{$board_url}/viewtopic.{$phpEx}", 't=' . $row['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'], true, ''); if ($config['feed_item_statistics']) { global $user; - $user_link = '' . $row[$this->get('creator')] . ''; + $user_link = 'get('author_id')], true, '') . '">' . $row[$this->get('creator')] . ''; $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link . ' - ' . $user->format_date($row['topic_time']). ' - ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' - ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; } @@ -1045,15 +1025,15 @@ function adjust_item(&$item_row, &$row) { - global $phpEx, $config; + global $board_url, $phpEx, $config; - $item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, 't=' . $row['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id']); + $item_row['link'] = append_sid("{$board_url}/viewtopic.{$phpEx}", 't=' . $row['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'], true, ''); if ($config['feed_item_statistics']) { global $user; - $user_link = '' . $row[$this->get('creator')] . ''; + $user_link = 'get('author_id')], true, '') . '">' . $row[$this->get('creator')] . ''; $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link . ' - ' . $user->format_date($row['topic_time']). ' - ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' - ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; } @@ -1061,4 +1041,4 @@ } -?> \ No newline at end of file +?>