phpBB

Code Changes

File: posting.php

  Unmodified   Added   Modified   Removed
Line 221Line 221
	}
trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST');
}

	}
trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST');
}

 

/**
* This event allows you to bypass reply/quote test of an unapproved post.
*
* @event core.posting_modify_row_data
* @var array post_data All post data from database
* @var string mode What action to take if the form has been submitted
* post|reply|quote|edit|delete|bump|smilies|popup
* @var int topic_id ID of the topic
* @var int forum_id ID of the forum
* @since 3.2.8-RC1
*/
$vars = array(
'post_data',
'mode',
'topic_id',
'forum_id',
);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_row_data', compact($vars)));


// Not able to reply to unapproved posts/topics
// TODO: add more descriptive language key


// Not able to reply to unapproved posts/topics
// TODO: add more descriptive language key

Line 236Line 255
}

$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);

}

$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);


if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_POST);
}

 

// Use post_row values in favor of submitted ones...
$forum_id = (!empty($post_data['forum_id'])) ? (int) $post_data['forum_id'] : (int) $forum_id;


// Use post_row values in favor of submitted ones...
$forum_id = (!empty($post_data['forum_id'])) ? (int) $post_data['forum_id'] : (int) $forum_id;

Line 406Line 419
	}

login_box('', $message);

	}

login_box('', $message);

 
}

if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_POST);

}

// Is the user able to post within this forum?

}

// Is the user able to post within this forum?

Line 955Line 974
	}

// Parse Attachments - before checksum is calculated

	}

// Parse Attachments - before checksum is calculated

 
	if ($message_parser->check_attachment_form_token($language, $request, 'posting'))
{

	$message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);

	$message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);

 
	}


/**
* This event allows you to modify message text before parsing


/**
* This event allows you to modify message text before parsing

Line 1159Line 1181
		$error[] = $user->lang['EMPTY_SUBJECT'];
}


		$error[] = $user->lang['EMPTY_SUBJECT'];
}


	// Check for out-of-bounds characters that are currently
// not supported by utf8_bin in MySQL














	/**
* Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR.
* Using their Numeric Character Reference's Hexadecimal notation.
* Check the permissions for posting Emojis first.
*/
if ($auth->acl_get('u_emoji'))
{
$post_data['post_subject'] = utf8_encode_ucr($post_data['post_subject']);
}
else
{
/**
* Check for out-of-bounds characters that are currently
* not supported by utf8_bin in MySQL
*/

	if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $post_data['post_subject'], $matches))
{

	if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $post_data['post_subject'], $matches))
{

		$character_list = implode('<br />', $matches[0]);


			$character_list = implode('<br>', $matches[0]);


		$error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list);

		$error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list);

 
		}

	}

$post_data['poll_last_vote'] = (isset($post_data['poll_last_vote'])) ? $post_data['poll_last_vote'] : 0;

	}

$post_data['poll_last_vote'] = (isset($post_data['poll_last_vote'])) ? $post_data['poll_last_vote'] : 0;

Line 1648Line 1685
						'time'    => $post_data['post_time'],
'user_id' => $post_data['poster_id'],
);

						'time'    => $post_data['post_time'],
'user_id' => $post_data['poster_id'],
);

 

/**
* This event allows you to modify the quote attributes of the post being quoted
*
* @event core.posting_modify_quote_attributes
* @var array quote_attributes Array with quote attributes
* @var array post_data Array with post data
* @since 3.2.6-RC1
*/
$vars = array(
'quote_attributes',
'post_data',
);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_quote_attributes', compact($vars)));


/** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');


/** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');

Line 1657Line 1708
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
{
$post_data['post_subject'] = ((strpos($post_data['post_subject'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($post_data['post_subject']);

if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
{
$post_data['post_subject'] = ((strpos($post_data['post_subject'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($post_data['post_subject']);

 

$post_subject = $post_data['post_subject'];

/**
* This event allows you to modify the post subject of the post being quoted
*
* @event core.posting_modify_post_subject
* @var string post_subject String with the post subject already censored.
* @since 3.2.8-RC1
*/
$vars = array('post_subject');
extract($phpbb_dispatcher->trigger_event('core.posting_modify_post_subject', compact($vars)));

$post_data['post_subject'] = $post_subject;

}

$attachment_data = $message_parser->attachment_data;

}

$attachment_data = $message_parser->attachment_data;