<commit_before><?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

require_once ('tiki-setup.php');
require_once ('lib/tikilib.php');
require_once ('lib/blogs/bloglib.php');
require_once ('lib/rss/rsslib.php');

if ($prefs['feed_blogs'] != 'y' && $prefs['feed_blog'] != 'y') {
	$errmsg = tra('rss feed disabled');
	require_once ('tiki-rss_error.php');
}

if (!isset($_REQUEST['blogId'])) {
	$errmsg = tra('No blogId specified');
	require_once ('tiki-rss_error.php');
}

$smarty->assign('individual', 'n');
$tikilib->get_perm_object($_REQUEST['blogId'], 'blog');

if ($tiki_p_read_blog != 'y') {
	$smarty->assign('errortype', 401);
	$errmsg = tra('You do not have permission to view this section');
	require_once ('tiki-rss_error.php');
}

$feed = 'blog';
$id = 'blogId';
$uniqueid = "$feed.$id=" . $_REQUEST["$id"];
$output = $rsslib->get_from_cache($uniqueid);

if ($output['data'] == 'EMPTY') {
	$tmp = $bloglib->get_blog($_REQUEST["$id"]);
	$title = $prefs['feed_' . $feed . '_title'];
	$title.= $tmp['title'];
	$desc.= $prefs['feed_' . $feed . '_desc'];
	$desc.= $tmp['description'];
	$descId = 'data';
	$dateId = 'created';
	$authorId = 'user';
	$titleId = 'title';
	$readrepl = 'tiki-view_blog_post.php?postId=%s';
	$changes = $bloglib->list_blog_posts($_REQUEST["$id"], false, 0, $prefs['feed_blog_max'], $dateId . '_desc', '', '', $tikilib->now);
	$tmp = array();
	include_once ('tiki-sefurl.php');
	foreach ($changes['data'] as $data) {
		$data['$descId'] = $tikilib->parse_data(
						$data[$descId],
						array(
							'print' => true,
							'is_html' => true,
						)
		);
		$data['sefurl'] = filter_out_sefurl(sprintf($readrepl, $data['postId']), 'blogpost', urlencode($data['title']));
		$tmp[] = $data;
	}
	$changes['data'] = $tmp;
	$tmp = null;
	$output = $rsslib->generate_feed(
					$feed,
					$uniqueid,
					'',
					$changes,
					$readrepl,
					'blogId',
					'',
					$title,
					$titleId,
					$desc,
					$descId,
					$dateId,
					$authorId,
					false
	);
}<commit_msg>[FIX] Individual blog feeds: raw post content (r40224 regression) [REF] Avoid constant $descId variable (what's the point?)<commit_after><?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

require_once ('tiki-setup.php');
require_once ('lib/tikilib.php');
require_once ('lib/blogs/bloglib.php');
require_once ('lib/rss/rsslib.php');

if ($prefs['feed_blogs'] != 'y' && $prefs['feed_blog'] != 'y') {
	$errmsg = tra('rss feed disabled');
	require_once ('tiki-rss_error.php');
}

if (!isset($_REQUEST['blogId'])) {
	$errmsg = tra('No blogId specified');
	require_once ('tiki-rss_error.php');
}

$smarty->assign('individual', 'n');
$tikilib->get_perm_object($_REQUEST['blogId'], 'blog');

if ($tiki_p_read_blog != 'y') {
	$smarty->assign('errortype', 401);
	$errmsg = tra('You do not have permission to view this section');
	require_once ('tiki-rss_error.php');
}

$feed = 'blog';
$id = 'blogId';
$uniqueid = "$feed.$id=" . $_REQUEST["$id"];
$output = $rsslib->get_from_cache($uniqueid);

if ($output['data'] == 'EMPTY') {
	$tmp = $bloglib->get_blog($_REQUEST["$id"]);
	$title = $prefs['feed_' . $feed . '_title'];
	$title.= $tmp['title'];
	$desc.= $prefs['feed_' . $feed . '_desc'];
	$desc.= $tmp['description'];
	$dateId = 'created';
	$authorId = 'user';
	$titleId = 'title';
	$readrepl = 'tiki-view_blog_post.php?postId=%s';
	$changes = $bloglib->list_blog_posts($_REQUEST["$id"], false, 0, $prefs['feed_blog_max'], $dateId . '_desc', '', '', $tikilib->now);
	$tmp = array();
	include_once ('tiki-sefurl.php');
	foreach ($changes['data'] as $data) {
		$data['data'] = $tikilib->parse_data(
						$data['data'],
						array(
							'print' => true,
							'is_html' => true,
						)
		);
		$data['sefurl'] = filter_out_sefurl(sprintf($readrepl, $data['postId']), 'blogpost', urlencode($data['title']));
		$tmp[] = $data;
	}
	$changes['data'] = $tmp;
	$tmp = null;
	$output = $rsslib->generate_feed(
					$feed,
					$uniqueid,
					'',
					$changes,
					$readrepl,
					'blogId',
					'',
					$title,
					$titleId,
					$desc,
					'data',
					$dateId,
					$authorId,
					false
	);
}
{'fraction_non_alphanumeric': 0.2168141592920354, 'fraction_numerical': 0.006415929203539823, 'mean_word_length': 4.2145328719723185, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7415990', 'n_tokens_mistral': 1904, 'n_tokens_neox': 1681, 'n_words': 358}