Vergleich inc/datahandlers/post.php - 1.8.17 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 261Zeile 261
			if(stripos($db->type, 'my') !== false)
{
$fields = $db->show_fields_from("posts");

			if(stripos($db->type, 'my') !== false)
{
$fields = $db->show_fields_from("posts");

				$dblimit = reset(array_filter(array_map(function($field)


				$type = $fields[array_search('message', array_column($fields, 'Field'))]['Type'];
switch(strtolower($type))

				{

				{

					if($field['Field'] == 'message')
{
switch(strtolower($field['Type']))
{
case 'longtext':
return 4294967295;
break;
case 'mediumtext':
return 16777215;
break;
case 'text':
default:
return 65535;
break;
}
}
}, $fields)));
}

					case 'longtext':
$dblimit = 4294967295;
break;
case 'mediumtext':
$dblimit = 16777215;
break;
case 'text':
default:
$dblimit = 65535;
break;
}
}








if($limit > 0 || $dblimit > 0)
{


if($limit > 0 || $dblimit > 0)
{

Zeile 289Zeile 284
				if($limit > 0 && $dblimit > 0)
{
$limit = $is_moderator ? $dblimit : min($limit, $dblimit);

				if($limit > 0 && $dblimit > 0)
{
$limit = $is_moderator ? $dblimit : min($limit, $dblimit);

				}

				}

				else
{
$limit = max($limit, $dblimit);

				else
{
$limit = max($limit, $dblimit);

Zeile 298Zeile 293
				if(strlen($post['message']) > $limit && (!$is_moderator || $limit == $dblimit))
{
$this->set_error("message_too_long", array($limit, strlen($post['message'])));

				if(strlen($post['message']) > $limit && (!$is_moderator || $limit == $dblimit))
{
$this->set_error("message_too_long", array($limit, strlen($post['message'])));

					return false;
}
}


					return false;
}
}


			if(!isset($post['fid']))
{
$post['fid'] = 0;

			if(!isset($post['fid']))
{
$post['fid'] = 0;

			}

			}


if(!$mybb->settings['mycodemessagelength'])


if(!$mybb->settings['mycodemessagelength'])

			{

			{

				// Check to see of the text is full of MyCode
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

				// Check to see of the text is full of MyCode
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

Zeile 324Zeile 319
			else if(my_strlen($post['message']) < $mybb->settings['minmessagelength'] && $mybb->settings['minmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid']))
{
$this->set_error("message_too_short", array($mybb->settings['minmessagelength']));

			else if(my_strlen($post['message']) < $mybb->settings['minmessagelength'] && $mybb->settings['minmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid']))
{
$this->set_error("message_too_short", array($mybb->settings['minmessagelength']));

				return false;
}
}

				return false;
}
}

		return true;
}


		return true;
}


Zeile 376Zeile 371
				if($time_to_wait == 1)
{
$this->set_error("post_flooding_one_second");

				if($time_to_wait == 1)
{
$this->set_error("post_flooding_one_second");

				}

				}

				else
{
$this->set_error("post_flooding", array($time_to_wait));

				else
{
$this->set_error("post_flooding", array($time_to_wait));

Zeile 401Zeile 396

// Are we starting a new thread?
if(empty($post['tid']))


// Are we starting a new thread?
if(empty($post['tid']))

		{

		{

			return true;
}

// Are we even turned on?
if(empty($mybb->settings['postmergemins']))

			return true;
}

// Are we even turned on?
if(empty($mybb->settings['postmergemins']))

		{
return true;

		{
return true;

		}

// Assign a default separator if none is specified

		}

// Assign a default separator if none is specified

Zeile 426Zeile 421
		// Select the lastpost and fid information for this thread
$query = $db->simple_select("threads", "lastpost,fid", "lastposteruid='".$post['uid']."' AND tid='".$post['tid']."'", array('limit' => '1'));
$thread = $db->fetch_array($query);

		// Select the lastpost and fid information for this thread
$query = $db->simple_select("threads", "lastpost,fid", "lastposteruid='".$post['uid']."' AND tid='".$post['tid']."'", array('limit' => '1'));
$thread = $db->fetch_array($query);





		// Check to see if the same author has posted within the merge post time limit
if(((int)$mybb->settings['postmergemins'] != 0 && trim($mybb->settings['postmergemins']) != "") && (TIME_NOW-$thread['lastpost']) > ((int)$mybb->settings['postmergemins']*60))
{

		// Check to see if the same author has posted within the merge post time limit
if(((int)$mybb->settings['postmergemins'] != 0 && trim($mybb->settings['postmergemins']) != "") && (TIME_NOW-$thread['lastpost']) > ((int)$mybb->settings['postmergemins']*60))
{

Zeile 476Zeile 471

/**
* Verifies the image count.


/**
* Verifies the image count.

	*

	*

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

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

Zeile 878Zeile 873
		}

// Fetch the thread

		}

// Fetch the thread

		$thread = get_thread($post['tid']);

		$thread = get_thread($post['tid']);


$closed = $thread['closed'];



$closed = $thread['closed'];


Zeile 954Zeile 949
				{
$modoptions_update['sticky'] = 0;
log_moderator_action($modlogdata, $lang->thread_unstuck);

				{
$modoptions_update['sticky'] = 0;
log_moderator_action($modlogdata, $lang->thread_unstuck);

				}

				}


// Execute moderation options.
if($modoptions_update)
{
$db->update_query('threads', $modoptions_update, "tid='{$thread['tid']}'");
}


// Execute moderation options.
if($modoptions_update)
{
$db->update_query('threads', $modoptions_update, "tid='{$thread['tid']}'");
}

			}

			}


// Fetch the forum this post is being made in
$forum = get_forum($post['fid']);


// Fetch the forum this post is being made in
$forum = get_forum($post['fid']);

Zeile 979Zeile 974

// Are posts from this user being moderated? Change visibility
if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1)


// Are posts from this user being moderated? Change visibility
if($mybb->user['uid'] == $post['uid'] && $mybb->user['moderateposts'] == 1)

			{

			{

				$visible = 0;
}
}

				$visible = 0;
}
}

Zeile 1079Zeile 1074
		{
// Update a post that is a draft
$this->post_update_data = array(

		{
// Update a post that is a draft
$this->post_update_data = array(

				"subject" => $db->escape_string($post['subject']),

				"subject" => $db->escape_string($post['subject']),

				"icon" => (int)$post['icon'],
"uid" => $post['uid'],
"username" => $db->escape_string($post['username']),

				"icon" => (int)$post['icon'],
"uid" => $post['uid'],
"username" => $db->escape_string($post['username']),

Zeile 1479Zeile 1474

// 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']),

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

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

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

Zeile 1883Zeile 1878
				$plugins->run_hooks("datahandler_post_update_thread", $this);

$db->update_query("threads", $this->thread_update_data, "tid='".(int)$post['tid']."'");

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

$db->update_query("threads", $this->thread_update_data, "tid='".(int)$post['tid']."'");

 
			}

// Update any moved thread links to have corresponding new subject.
if(isset($post['subject']))
{
$query = $db->simple_select("threads", "tid, closed", "closed='moved|".$this->tid."'");
if($db->num_rows($query) > 0)
{
$update_data['subject'] = $db->escape_string($post['subject']);
while($result = $db->fetch_array($query))
{
$db->update_query("threads", $update_data, "tid='".(int)$result['tid']."'");
}
}

			}
}


			}
}