Vergleich inc/datahandlers/post.php - 1.6.11 - 1.6.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 146Zeile 146
		$post = &$this->data;
$subject = &$post['subject'];
$subject = trim_blank_chrs($subject);

		$post = &$this->data;
$subject = &$post['subject'];
$subject = trim_blank_chrs($subject);

		$subject = utf8_handle_4byte_string($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 240Zeile 239

$post = &$this->data;
$post['message'] = trim_blank_chrs($post['message']);


$post = &$this->data;
$post['message'] = trim_blank_chrs($post['message']);

		$post['message'] = utf8_handle_4byte_string($post['message']);

 

// Do we even have a message at all?
if(my_strlen($post['message']) == 0)


// Do we even have a message at all?
if(my_strlen($post['message']) == 0)

Zeile 548Zeile 546

$post = &$this->data;



$post = &$this->data;


		// If we don't assign it as 0.
if(!$post['icon'] || $post['icon'] < 0)



		$posticons_cache = $cache->read("posticons");

// If we don't have a post icon assign it as 0.
if(empty($post['icon']) || !isset($posticons_cache[$post['icon']]))

		{
$post['icon'] = 0;
}
return true;

		{
$post['icon'] = 0;
}
return true;

	}

	}


/**
* Verify the dateline.


/**
* Verify the dateline.

Zeile 562Zeile 562
	* @return boolean True when valid, false when not valid.
*/
function verify_dateline()

	* @return boolean True when valid, false when not valid.
*/
function verify_dateline()

	{

	{

		$dateline = &$this->data['dateline'];

// The date has to be numeric and > 0.

		$dateline = &$this->data['dateline'];

// The date has to be numeric and > 0.

Zeile 571Zeile 571
			$dateline = TIME_NOW;
}
}

			$dateline = TIME_NOW;
}
}





	/**
* Verify thread prefix.
*

	/**
* Verify thread prefix.
*

Zeile 582Zeile 582
		$prefix = &$this->data['prefix'];

// If a valid prefix isn't supplied, don't assign one.

		$prefix = &$this->data['prefix'];

// If a valid prefix isn't supplied, don't assign one.

		if(!$prefix || $prefix < 1)

		if(empty($prefix))

		{
$prefix = 0;

		{
$prefix = 0;

 
		}
else
{
$verification = build_prefixes($prefix);
if(!$verification)
{
$this->set_error('invalid_prefix');
return false;
}
if($verification['groups'] != "-1")
{
if(!empty($this->data['edit_uid']))
{
// Post is being edited
$user = get_user($this->data['edit_uid']);
}
else
{
$user = get_user($this->data['uid']);
}
$groups = array($user['usergroup']);
if(!empty($user['additionalgroups']))
{
$groups = array_merge($groups, explode(',', $user['additionalgroups']));
}
$prefix_groups = explode(",", $verification['groups']);

$valid_group = false;
foreach($groups as $group)
{
if(in_array($group, $prefix_groups))
{
$valid_group = true;
break;
}
}
if(!$valid_group)
{
$this->set_error('invalid_prefix');
return false;
}
}
if($verification['forums'] != "-1")
{
// Decide whether this prefix can be used in our forum
$forums = explode(",", $verification['forums']);

if(!in_array($this->data['fid'], $forums))
{
$this->set_error('invalid_prefix');
return false;
}
}

		}

return true;

		}

return true;

Zeile 921Zeile 974
				"posthash" => ''
);
$db->update_query("attachments", $attachmentassign, "posthash='{$post['posthash']}' AND pid='0'");

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

		}


		}


		if($visible == 1 && $thread['visible'] == 1)
{
$thread = get_thread($post['tid']);

		if($visible == 1 && $thread['visible'] == 1)
{
$thread = get_thread($post['tid']);

Zeile 1190Zeile 1243

// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
if($draft_check)


// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
if($draft_check)

		{
$this->thread_insert_data = array(
"subject" => $db->escape_string($thread['subject']),
"icon" => intval($thread['icon']),
"username" => $db->escape_string($thread['username']),
"dateline" => intval($thread['dateline']),
"lastpost" => intval($thread['dateline']),
"lastposter" => $db->escape_string($thread['username']),
"visible" => $visible
);

$plugins->run_hooks("datahandler_post_insert_thread", $this);

$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");

$this->post_insert_data = array(

		{
$this->thread_insert_data = array(















				"subject" => $db->escape_string($thread['subject']),
"icon" => intval($thread['icon']),
"username" => $db->escape_string($thread['username']),
"dateline" => intval($thread['dateline']),

				"subject" => $db->escape_string($thread['subject']),
"icon" => intval($thread['icon']),
"username" => $db->escape_string($thread['username']),
"dateline" => intval($thread['dateline']),

				"message" => $db->escape_string($thread['message']),
"ipaddress" => $db->escape_string(get_ip()),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],















				"lastpost" => intval($thread['dateline']),
"lastposter" => $db->escape_string($thread['username']),
"visible" => $visible
);

$plugins->run_hooks("datahandler_post_insert_thread", $this);

$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");

$this->post_insert_data = array(
"subject" => $db->escape_string($thread['subject']),
"icon" => intval($thread['icon']),
"username" => $db->escape_string($thread['username']),
"dateline" => intval($thread['dateline']),
"message" => $db->escape_string($thread['message']),
"ipaddress" => $db->escape_string(get_ip()),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],

				"visible" => $visible
);
$plugins->run_hooks("datahandler_post_insert_thread_post", $this);

				"visible" => $visible
);
$plugins->run_hooks("datahandler_post_insert_thread_post", $this);

Zeile 1225Zeile 1278

// Inserting a new thread into the database.
else


// Inserting a new thread into the database.
else

		{

		{

			$this->thread_insert_data = array(
"fid" => $thread['fid'],
"subject" => $db->escape_string($thread['subject']),

			$this->thread_insert_data = array(
"fid" => $thread['fid'],
"subject" => $db->escape_string($thread['subject']),

Zeile 1283Zeile 1336
					default:
$notification = 0;
}

					default:
$notification = 0;
}





				require_once MYBB_ROOT."inc/functions_user.php";
add_subscribed_thread($this->tid, $notification, $thread['uid']);
}

				require_once MYBB_ROOT."inc/functions_user.php";
add_subscribed_thread($this->tid, $notification, $thread['uid']);
}

Zeile 1294Zeile 1347
				$lang->load($this->language_file, true);

$modoptions = $thread['modoptions'];

				$lang->load($this->language_file, true);

$modoptions = $thread['modoptions'];

				$modlogdata['fid'] = $this->tid;
$modlogdata['tid'] = $thread['tid'];

				$modlogdata['fid'] = $thread['fid'];
$modlogdata['tid'] = $this->tid;


// Close the thread.
if($modoptions['closethread'] == 1)


// Close the thread.
if($modoptions['closethread'] == 1)