<commit_before><?php

function Streams_stream_response_content()
{
	$publisherId = Streams::requestedPublisherId(true);
	$name = Streams::requestedName(true);
	$fields = Streams::requestedFields();
	$user = Users::loggedInUser();
	$userId = $user ? $user->id : 0;
	$stream = isset(Streams::$cache['stream']) ? Streams::$cache['stream'] : null;

	if (!isset($stream)) {
		throw new Q_Exception_MissingRow(array('table' => 'stream', 'criteria' => 'that name'));
	}
	if ($publisherId != $userId and !$stream->testReadLevel('content')) {
		Q_Response::setNotice('Streams/stream/response/content', 'This content is hidden from you.', true);
		return '';
	}

	// show stream as usual
	return Q::view('Streams/content/stream.php', compact(
		'publisherId', 'name', 'fields',
		'user', 'stream'
	));
}<commit_msg>Fixed Streams/stream/response/content when stream shouldn't be seen<commit_after><?php

function Streams_stream_response_content()
{
	$publisherId = Streams::requestedPublisherId(true);
	$name = Streams::requestedName(true);
	$fields = Streams::requestedFields();
	$user = Users::loggedInUser();
	$userId = $user ? $user->id : 0;
	$stream = isset(Streams::$cache['stream']) ? Streams::$cache['stream'] : null;

	if (!isset($stream) or !$stream->testReadLevel('see')) {
		throw new Q_Exception_MissingRow(array('table' => 'stream', 'criteria' => 'that name'));
	}
	if ($publisherId != $userId and !$stream->testReadLevel('content')) {
		Q_Response::setNotice('Streams/stream/response/content', 'This content is hidden from you.', true);
		return '';
	}

	// show stream as usual
	return Q::view('Streams/content/stream.php', compact(
		'publisherId', 'name', 'fields',
		'user', 'stream'
	));
}
{'fraction_non_alphanumeric': 0.19081272084805653, 'fraction_numerical': 0.001177856301531213, 'mean_word_length': 6.168776371308017, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '5629768', 'n_tokens_mistral': 581, 'n_tokens_neox': 568, 'n_words': 116}