本文整理匯總了PHP中FeatherBB\Core\Utils::strip_bad_multibyte_chars方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils::strip_bad_multibyte_chars方法的具體用法?PHP Utils::strip_bad_multibyte_chars怎麽用?PHP Utils::strip_bad_multibyte_chars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FeatherBB\Core\Utils
的用法示例。
在下文中一共展示了Utils::strip_bad_multibyte_chars方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setup_edit_variables
public function setup_edit_variables($cur_post, $is_admmod, $can_edit_subject, $errors)
{
Container::get('hooks')->fire('model.post.setup_edit_variables_start');
$post = array();
$post['hide_smilies'] = Input::post('hide_smilies') ? '1' : '0';
$post['stick_topic'] = Input::post('stick_topic') ? '1' : '0';
if (!$is_admmod) {
$post['stick_topic'] = $cur_post['sticky'];
}
// Clean up message from POST
$post['message'] = Utils::linebreaks(Utils::trim(Input::post('req_message')));
// Validate BBCode syntax
if (ForumSettings::get('p_message_bbcode') == '1') {
$post['message'] = Container::get('parser')->preparse_bbcode($post['message'], $errors);
}
// Replace four-byte characters (MySQL cannot handle them)
$post['message'] = Utils::strip_bad_multibyte_chars($post['message']);
// Get the subject
if ($can_edit_subject) {
$post['subject'] = Utils::trim(Input::post('req_subject'));
}
$post = Container::get('hooks')->fire('model.post.setup_edit_variables', $post);
return $post;
}
示例2: setup_variables
public function setup_variables($cur_post, $is_admmod, $can_edit_subject, $errors)
{
$this->hook->fire('setup_variables_start');
$post = array();
$post['hide_smilies'] = $this->request->post('hide_smilies') ? '1' : '0';
$post['stick_topic'] = $this->request->post('stick_topic') ? '1' : '0';
if (!$is_admmod) {
$post['stick_topic'] = $cur_post['sticky'];
}
// Clean up message from POST
$post['message'] = Utils::linebreaks(Utils::trim($this->request->post('req_message')));
// Validate BBCode syntax
if ($this->config['p_message_bbcode'] == '1') {
$post['message'] = $this->feather->parser->preparse_bbcode($post['message'], $errors);
}
// Replace four-byte characters (MySQL cannot handle them)
$post['message'] = Utils::strip_bad_multibyte_chars($post['message']);
// Get the subject
if ($can_edit_subject) {
$post['subject'] = Utils::trim($this->request->post('req_subject'));
}
$post = $this->hook->fire('setup_variables_edit', $post);
return $post;
}
示例3: setup_variables
public function setup_variables($errors, $is_admmod)
{
$post = array();
$post = $this->hook->fire('setup_variables_start', $post, $errors, $is_admmod);
if (!$this->user->is_guest) {
$post['username'] = $this->user->username;
$post['email'] = $this->user->email;
} else {
$post['username'] = Utils::trim($this->request->post('req_username'));
$post['email'] = strtolower(Utils::trim($this->config['p_force_guest_email'] == '1' ? $this->request->post('req_email') : $this->request->post('email')));
}
if ($this->request->post('req_subject')) {
$post['subject'] = Utils::trim($this->request->post('req_subject'));
}
$post['hide_smilies'] = $this->request->post('hide_smilies') ? '1' : '0';
$post['subscribe'] = $this->request->post('subscribe') ? '1' : '0';
$post['stick_topic'] = $this->request->post('stick_topic') && $is_admmod ? '1' : '0';
$post['message'] = Utils::linebreaks(Utils::trim($this->request->post('req_message')));
// Validate BBCode syntax
if ($this->config['p_message_bbcode'] == '1') {
$post['message'] = $this->feather->parser->preparse_bbcode($post['message'], $errors);
}
// Replace four-byte characters (MySQL cannot handle them)
$post['message'] = Utils::strip_bad_multibyte_chars($post['message']);
$post['time'] = time();
$post = $this->hook->fire('setup_variables', $post);
return $post;
}