當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utils::strip_bad_multibyte_chars方法代碼示例

本文整理匯總了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;
 }
開發者ID:featherbb,項目名稱:featherbb,代碼行數:24,代碼來源:Post.php

示例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;
 }
開發者ID:bohwaz,項目名稱:featherbb,代碼行數:24,代碼來源:Edit.php

示例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;
 }
開發者ID:bohwaz,項目名稱:featherbb,代碼行數:28,代碼來源:Post.php


注:本文中的FeatherBB\Core\Utils::strip_bad_multibyte_chars方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。