Пример #1
0
 public function setup_variables($errors, $is_admmod)
 {
     $post = array();
     if (!$this->user->is_guest) {
         $post['username'] = $this->user->username;
         $post['email'] = $this->user->email;
     } else {
         $post['username'] = feather_trim($this->request->post('req_username'));
         $post['email'] = strtolower(feather_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'] = feather_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'] = feather_linebreaks(feather_trim($this->request->post('req_message')));
     // Validate BBCode syntax
     if ($this->config['p_message_bbcode'] == '1') {
         require_once FEATHER_ROOT . 'include/parser.php';
         $post['message'] = preparse_bbcode($post['message'], $errors);
     }
     // Replace four-byte characters (MySQL cannot handle them)
     $post['message'] = strip_bad_multibyte_chars($post['message']);
     $post['time'] = time();
     return $post;
 }
Пример #2
0
             // Censor message to see if that causes problems
             $censored_message = panther_trim(censor_words($message));
             if ($censored_message == '') {
                 $errors[] = $lang_post['No message after censoring'];
             }
         }
     }
 }
 $hide_smilies = isset($_POST['hide_smilies']) ? '1' : '0';
 $stick_topic = isset($_POST['stick_topic']) ? '1' : '0';
 $add_poll = isset($_POST['add_poll']) && $cur_post['post_polls'] != '0' && $panther_user['g_post_polls'] == '1' && $panther_config['o_polls'] == '1' ? '1' : '0';
 if (!$is_admmod) {
     $stick_topic = $cur_post['sticky'];
 }
 // Replace four-byte characters (MySQL cannot handle them)
 $message = strip_bad_multibyte_chars($message);
 // Did everything go according to plan?
 if (empty($errors) && !isset($_POST['preview'])) {
     $edit_reason = isset($_POST['edit_reason']) && $is_admmod ? panther_trim($_POST['edit_reason']) : $cur_post['edit_reason'];
     require PANTHER_ROOT . 'include/search_idx.php';
     if ($can_edit_subject) {
         $update = array('subject' => $subject, 'sticky' => $stick_topic);
         $data = array(':id' => $cur_post['tid'], ':moved' => $cur_post['tid']);
         // Update the topic and any redirect topics
         $db->update('topics', $update, 'id=:id OR moved_to=:moved', $data);
         // We changed the subject, so we need to take that into account when we update the search words
         update_search_index('edit', $id, $message, $subject);
         // If this is the last topic in the forum, and we've changed the subject, we need to update that
         if ($cur_post['last_topic_id'] == $cur_post['tid'] && $subject != $cur_post['subject']) {
             update_forum($cur_post['fid']);
         }
Пример #3
0
 public function setup_variables($cur_post, $is_admmod, $can_edit_subject, $errors)
 {
     global $pd;
     $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'] = feather_linebreaks(feather_trim($this->request->post('req_message')));
     // Validate BBCode syntax
     if ($this->config['p_message_bbcode'] == '1') {
         require_once FEATHER_ROOT . 'include/parser.php';
         $post['message'] = preparse_bbcode($post['message'], $errors);
     }
     // Replace four-byte characters (MySQL cannot handle them)
     $post['message'] = strip_bad_multibyte_chars($post['message']);
     // Get the subject
     if ($can_edit_subject) {
         $post['subject'] = feather_trim($this->request->post('req_subject'));
     }
     return $post;
 }