Vergleich inc/datahandlers/post.php - 1.4.9 - 1.4.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: post.php 4372 2009-05-15 16:13:13Z Tomm $

 * $Id: post.php 4867 2010-04-11 03:37:10Z RyanGordon $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 404Zeile 404
		$permissions = user_permissions($post['uid']);

// Fetch the forum this post is being made in

		$permissions = user_permissions($post['uid']);

// Fetch the forum this post is being made in

 
		if(!$post['fid'])
{
$query = $db->simple_select('posts', 'fid', "pid = '{$post['pid']}'");
$post['fid'] = $db->fetch_field($query, 'fid');
}

		$forum = get_forum($post['fid']);

// Check if this post contains more images than the forum allows

		$forum = get_forum($post['fid']);

// Check if this post contains more images than the forum allows

Zeile 427Zeile 432
			else
{
$parser_options['allow_smilies'] = 0;

			else
{
$parser_options['allow_smilies'] = 0;

			}


			}


			$image_check = $parser->parse_message($post['message'], $parser_options);

// And count the number of image tags in the message.

			$image_check = $parser->parse_message($post['message'], $parser_options);

// And count the number of image tags in the message.

Zeile 444Zeile 449

/**
* Verify the reply-to post.


/**
* Verify the reply-to post.

	*
* @return boolean True when valid, false when not valid.
*/

	*
* @return boolean True when valid, false when not valid.
*/

	function verify_reply_to()
{
global $db;

	function verify_reply_to()
{
global $db;

Zeile 531Zeile 536
		$post = &$this->data;
$time = TIME_NOW;


		$post = &$this->data;
$time = TIME_NOW;


		$this->action = "post";


		$this->action = "post";


		if($this->method != "update" && !$post['savedraft'])
{
$this->verify_post_flooding();

		if($this->method != "update" && !$post['savedraft'])
{
$this->verify_post_flooding();

		}

// Verify all post assets.

		}

// Verify all post assets.


if($this->method == "insert" || array_key_exists('uid', $post))
{
$this->verify_author();


if($this->method == "insert" || array_key_exists('uid', $post))
{
$this->verify_author();

		}

		}


if($this->method == "insert" || array_key_exists('subject', $post))
{
$this->verify_subject();


if($this->method == "insert" || array_key_exists('subject', $post))
{
$this->verify_subject();

		}

		}


if($this->method == "insert" || array_key_exists('message', $post))
{


if($this->method == "insert" || array_key_exists('message', $post))
{

Zeile 559Zeile 564
		if($this->method == "insert" || array_key_exists('dateline', $post))
{
$this->verify_dateline();

		if($this->method == "insert" || array_key_exists('dateline', $post))
{
$this->verify_dateline();

		}

		}


if($this->method == "insert" || array_key_exists('replyto', $post))
{
$this->verify_reply_to();


if($this->method == "insert" || array_key_exists('replyto', $post))
{
$this->verify_reply_to();

		}

		}


if($this->method == "insert" || array_key_exists('icon', $post))
{


if($this->method == "insert" || array_key_exists('icon', $post))
{

Zeile 574Zeile 579
		if($this->method == "insert" || array_key_exists('options', $post))
{
$this->verify_options();

		if($this->method == "insert" || array_key_exists('options', $post))
{
$this->verify_options();

		}

		}


$plugins->run_hooks_by_ref("datahandler_post_validate_post", $this);



$plugins->run_hooks_by_ref("datahandler_post_validate_post", $this);


Zeile 589Zeile 594
			return true;
}
}

			return true;
}
}






/**
* Insert a post into the database.


/**
* Insert a post into the database.

Zeile 610Zeile 615
		if(count($this->get_errors()) > 0)
{
die("The post is not valid.");

		if(count($this->get_errors()) > 0)
{
die("The post is not valid.");

		}

		}


// This post is being saved as a draft.
if($post['savedraft'])
{
$visible = -2;


// This post is being saved as a draft.
if($post['savedraft'])
{
$visible = -2;

		}


		}


		// Otherwise this post is being made now and we have a bit to do.
else
{

		// Otherwise this post is being made now and we have a bit to do.
else
{

Zeile 716Zeile 721
		{
$double_post = $this->verify_post_merge();


		{
$double_post = $this->verify_post_merge();


 
			// Only combine if they are both invisible (mod queue'd forum) or both visible

			if($double_post !== true && $double_post['visible'] == $visible)
{

			if($double_post !== true && $double_post['visible'] == $visible)
{

				// Only combine if they are both invisible (mod queue'd forum) or both visible
$double_post['message'] .= $mybb->settings['postmergesep']."\n".$post['message'];


				$this->pid = $double_post['pid'];

$post['message'] = $double_post['message'] .= $mybb->settings['postmergesep']."\n".$post['message'];

				$update_query = array(
"message" => $db->escape_string($double_post['message'])
);
$update_query['edituid'] = intval($post['uid']);
$update_query['edittime'] = TIME_NOW;
$query = $db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");

				$update_query = array(
"message" => $db->escape_string($double_post['message'])
);
$update_query['edituid'] = intval($post['uid']);
$update_query['edittime'] = TIME_NOW;
$query = $db->update_query("posts", $update_query, "pid='".$double_post['pid']."'");

				

				

				// Assign any uploaded attachments with the specific posthash to the merged post.
if($double_post['posthash'])
{

				// Assign any uploaded attachments with the specific posthash to the merged post.
if($double_post['posthash'])
{

Zeile 747Zeile 754
						"posthash" => $double_post['posthash'],
);
$db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}'");

						"posthash" => $double_post['posthash'],
);
$db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}'");

 
				
$post['posthash'] = $double_post['posthash'];

				}

// Return the post's pid and whether or not it is visible.

				}

// Return the post's pid and whether or not it is visible.

Zeile 914Zeile 923
					$emailmessage = $langcache[$uselang]['email_subscription'];
}
$emailsubject = $lang->sprintf($emailsubject, $subject);

					$emailmessage = $langcache[$uselang]['email_subscription'];
}
$emailsubject = $lang->sprintf($emailsubject, $subject);

				$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $post['username'], $mybb->settings['bbname'], $subject, $excerpt, $mybb->settings['bburl'], str_replace("&", "&", get_thread_link($thread['tid'], 0, "newpost")), $thread['tid'], $subscribedmember['subscriptionkey']);

				$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $post['username'], $mybb->settings['bbname'], $subject, $excerpt, $mybb->settings['bburl'], str_replace("&", "&", get_thread_link($thread['tid'], 0, "newpost")), $thread['tid'], $subscribedmember['subscriptionkey'], $mybb->post_code);

				$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',

				$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',

Zeile 1321Zeile 1330
						$emailmessage = $langcache[$uselang]['email_forumsubscription'];
}
$emailsubject = $lang->sprintf($emailsubject, $forum['name']);

						$emailmessage = $langcache[$uselang]['email_forumsubscription'];
}
$emailsubject = $lang->sprintf($emailsubject, $forum['name']);

					$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $thread['username'], $forum['name'], $mybb->settings['bbname'], $thread['subject'], $excerpt, $mybb->settings['bburl'], get_thread_link($this->tid), $thread['fid']);

					$emailmessage = $lang->sprintf($emailmessage, $subscribedmember['username'], $thread['username'], $forum['name'], $mybb->settings['bbname'], $thread['subject'], $excerpt, $mybb->settings['bburl'], get_thread_link($this->tid), $thread['fid'], $mybb->post_code);

					$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',

					$new_email = array(
"mailto" => $db->escape_string($subscribedmember['email']),
"mailfrom" => '',