Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: post.php 5412 2011-03-20 03:53:36Z jammerx2 $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 145 | Zeile 145 |
---|
global $db; $post = &$this->data; $subject = &$post['subject'];
|
global $db; $post = &$this->data; $subject = &$post['subject'];
|
| $subject = trim_blank_chrs($subject);
|
// Are we editing an existing thread or post? if($this->method == "update" && $post['pid'])
| // Are we editing an existing thread or post? if($this->method == "update" && $post['pid'])
|
Zeile 173 | Zeile 174 |
---|
}
// If this is the first post there needs to be a subject, else make it the default one.
|
}
// If this is the first post there needs to be a subject, else make it the default one.
|
if(my_strlen(trim_blank_chrs($subject)) == 0 && $first_post)
| if(my_strlen($subject) == 0 && $first_post)
|
{ $this->set_error("firstpost_no_subject"); return false;
| { $this->set_error("firstpost_no_subject"); return false;
|
Zeile 188 | Zeile 189 |
---|
// This is a new post else if($this->action == "post") {
|
// This is a new post else if($this->action == "post") {
|
if(my_strlen(trim_blank_chrs($subject)) == 0)
| if(my_strlen($subject) == 0)
|
{ $thread = get_thread($post['tid']); $subject = "RE: ".$thread['subject'];
| { $thread = get_thread($post['tid']); $subject = "RE: ".$thread['subject'];
|
Zeile 198 | Zeile 199 |
---|
// This is a new thread and we require that a subject is present. else {
|
// This is a new thread and we require that a subject is present. else {
|
if(my_strlen(trim_blank_chrs($subject)) == 0)
| if(my_strlen($subject) == 0)
|
{ $this->set_error("missing_subject"); return false; }
|
{ $this->set_error("missing_subject"); return false; }
|
| }
if(my_strlen($subject) > 85) { // Subject is too long $this->set_error('subject_too_long', my_strlen($subject)); return false;
|
}
// Subject is valid - return true. return true; }
|
}
// Subject is valid - return true. return true; }
|
|
|
/** * Verifies a post message. *
| /** * Verifies a post message. *
|
Zeile 219 | Zeile 227 |
---|
global $mybb;
$post = &$this->data;
|
global $mybb;
$post = &$this->data;
|
| $post['message'] = trim_blank_chrs($post['message']);
|
// Do we even have a message at all?
|
// Do we even have a message at all?
|
if(my_strlen(trim_blank_chrs($post['message'])) == 0)
| if(my_strlen($post['message']) == 0)
|
{ $this->set_error("missing_message"); return false;
| { $this->set_error("missing_message"); return false;
|
Zeile 626 | Zeile 635 |
---|
$this->verify_options(); }
|
$this->verify_options(); }
|
$plugins->run_hooks_by_ref("datahandler_post_validate_post", $this);
| $plugins->run_hooks("datahandler_post_validate_post", $this);
|
// We are done validating, return. $this->set_validated(true);
| // We are done validating, return. $this->set_validated(true);
|
Zeile 784 | Zeile 793 |
---|
{ $this->pid = $double_post['pid'];
|
{ $this->pid = $double_post['pid'];
|
$post['message'] = $double_post['message'] .= $mybb->settings['postmergesep']."\n".$post['message'];
| $post['message'] = $double_post['message'] .= "\n".$mybb->settings['postmergesep']."\n".$post['message'];
|
$update_query = array( "message" => $db->escape_string($double_post['message']) );
| $update_query = array( "message" => $db->escape_string($double_post['message']) );
|
Zeile 864 | Zeile 873 |
---|
"posthash" => $db->escape_string($post['posthash']) );
|
"posthash" => $db->escape_string($post['posthash']) );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_post", $this);
| $plugins->run_hooks("datahandler_post_insert_post", $this);
|
$db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'"); $this->pid = $post['pid'];
| $db->update_query("posts", $this->post_update_data, "pid='{$post['pid']}'"); $this->pid = $post['pid'];
|
Zeile 890 | Zeile 899 |
---|
"posthash" => $db->escape_string($post['posthash']) );
|
"posthash" => $db->escape_string($post['posthash']) );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_post", $this);
| $plugins->run_hooks("datahandler_post_insert_post", $this);
|
$this->pid = $db->insert_query("posts", $this->post_insert_data); }
| $this->pid = $db->insert_query("posts", $this->post_insert_data); }
|
Zeile 1081 | Zeile 1090 |
---|
$this->verify_options(); }
|
$this->verify_options(); }
|
$plugins->run_hooks_by_ref("datahandler_post_validate_thread", $this);
| $plugins->run_hooks("datahandler_post_validate_thread", $this);
|
// We are done validating, return. $this->set_validated(true);
| // We are done validating, return. $this->set_validated(true);
|
Zeile 1176 | Zeile 1185 |
---|
"visible" => $visible );
|
"visible" => $visible );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_thread", $this);
| $plugins->run_hooks("datahandler_post_insert_thread", $this);
|
$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");
| $db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");
|
Zeile 1192 | Zeile 1201 |
---|
"visible" => $visible, "posthash" => $db->escape_string($thread['posthash']) );
|
"visible" => $visible, "posthash" => $db->escape_string($thread['posthash']) );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_thread_post", $this);
| $plugins->run_hooks("datahandler_post_insert_thread_post", $this);
|
$db->update_query("posts", $this->post_insert_data, "pid='{$thread['pid']}'"); $this->tid = $thread['tid'];
| $db->update_query("posts", $this->post_insert_data, "pid='{$thread['pid']}'"); $this->tid = $thread['tid'];
|
Zeile 1218 | Zeile 1227 |
---|
"notes" => '' );
|
"notes" => '' );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_thread", $this);
| $plugins->run_hooks("datahandler_post_insert_thread", $this);
|
$this->tid = $db->insert_query("threads", $this->thread_insert_data);
| $this->tid = $db->insert_query("threads", $this->thread_insert_data);
|
Zeile 1238 | Zeile 1247 |
---|
"visible" => $visible, "posthash" => $db->escape_string($thread['posthash']) );
|
"visible" => $visible, "posthash" => $db->escape_string($thread['posthash']) );
|
$plugins->run_hooks_by_ref("datahandler_post_insert_thread_post", $this);
| $plugins->run_hooks("datahandler_post_insert_thread_post", $this);
|
$this->pid = $db->insert_query("posts", $this->post_insert_data);
| $this->pid = $db->insert_query("posts", $this->post_insert_data);
|
Zeile 1587 | Zeile 1596 |
---|
} if(count($this->thread_update_data) > 0) {
|
} if(count($this->thread_update_data) > 0) {
|
$plugins->run_hooks_by_ref("datahandler_post_update_thread", $this);
| $plugins->run_hooks("datahandler_post_update_thread", $this);
|
$db->update_query("threads", $this->thread_update_data, "tid='".intval($post['tid'])."'"); }
| $db->update_query("threads", $this->thread_update_data, "tid='".intval($post['tid'])."'"); }
|
Zeile 1633 | Zeile 1642 |
---|
$this->post_update_data['visible'] = $visible;
|
$this->post_update_data['visible'] = $visible;
|
$plugins->run_hooks_by_ref("datahandler_post_update", $this);
| $plugins->run_hooks("datahandler_post_update", $this);
|
$db->update_query("posts", $this->post_update_data, "pid='".intval($post['pid'])."'");
| $db->update_query("posts", $this->post_update_data, "pid='".intval($post['pid'])."'");
|