当前位置: 首页>>代码示例>>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;未经允许,请勿转载。