Vergleich inc/datahandlers/user.php - 1.8.7 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 187Zeile 187
		}

// Has the user tried to use their email address or username as a password?

		}

// Has the user tried to use their email address or username as a password?

		if($user['email'] === $user['password'] || $user['username'] === $user['password'])



		if($user['email'] === $user['password'] || $user['username'] === $user['password']
|| strpos($user['password'], $user['email']) !== false || strpos($user['password'], $user['username']) !== false
|| strpos($user['email'], $user['password']) !== false || strpos($user['username'], $user['password']) !== false)

		{
$this->set_error('bad_password_security');
return false;

		{
$this->set_error('bad_password_security');
return false;

Zeile 211Zeile 213
			$this->set_error("passwords_dont_match");
return false;
}

			$this->set_error("passwords_dont_match");
return false;
}


// MD5 the password
$user['md5password'] = md5($user['password']);

// Generate our salt
$user['salt'] = generate_salt();

// Combine the password and salt
$user['saltedpw'] = salt_password($user['md5password'], $user['salt']);

 

// Generate the user login key
$user['loginkey'] = generate_loginkey();


// Generate the user login key
$user['loginkey'] = generate_loginkey();

 

// Combine the password and salt
$password_fields = create_password($user['password'], false, $user);
$user = array_merge($user, $password_fields);


return true;
}

/**
* Verifies usergroup selections and other group details.


return true;
}

/**
* Verifies usergroup selections and other group details.

	*
* @return boolean True when valid, false when invalid.

	*
* @return boolean True when valid, false when invalid.

	*/
function verify_usergroup()
{

	*/
function verify_usergroup()
{

Zeile 238Zeile 235
	}
/**
* Verifies if an email address is valid or not.

	}
/**
* Verifies if an email address is valid or not.

	*
* @return boolean True when valid, false when invalid.

	*
* @return boolean True when valid, false when invalid.

	*/
function verify_email()
{

	*/
function verify_email()
{

Zeile 258Zeile 255
		if(!validate_email_format($user['email']))
{
$this->set_error('invalid_email_format');

		if(!validate_email_format($user['email']))
{
$this->set_error('invalid_email_format');

			return false;
}


			return false;
}


		// Check banned emails
if(is_banned_email($user['email'], true))
{

		// Check banned emails
if(is_banned_email($user['email'], true))
{

Zeile 303Zeile 300
	{
$website = &$this->data['website'];


	{
$website = &$this->data['website'];


		if(empty($website) || my_strtolower($website) == 'http://' || my_strtolower($website) == 'https://')
{
$website = '';
return true;
}

// Does the website start with http(s)://?
if(my_strtolower(substr($website, 0, 4)) != "http")

		if(!empty($website) && !my_validate_url($website))








		{

		{

			// Website does not start with http://, let's see if the user forgot.
$website = "http://".$website;

			$website = 'http://'.$website;


		}


		}


		if(!filter_var($website, FILTER_VALIDATE_URL))

		if(!empty($website) && !my_validate_url($website))

		{
$this->set_error('invalid_website');
return false;

		{
$this->set_error('invalid_website');
return false;

Zeile 585Zeile 574
						$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));
}


						$this->set_error('max_limit_reached', array($profilefield['name'], $profilefield['maxlength']));
}


					if(!empty($profilefield['regex']) && !preg_match("#".$profilefield['regex']."#i", $profile_fields[$field]))

					if(!empty($profilefield['regex']) && !empty($profile_fields[$field]) && !preg_match("#".$profilefield['regex']."#i", $profile_fields[$field]))

					{
$this->set_error('bad_profile_field_value', array($profilefield['name']));
}

					{
$this->set_error('bad_profile_field_value', array($profilefield['name']));
}

Zeile 612Zeile 601

// Does the referrer exist or not?
if($mybb->settings['usereferrals'] == 1 && $user['referrer'] != '')


// Does the referrer exist or not?
if($mybb->settings['usereferrals'] == 1 && $user['referrer'] != '')

		{

		{

			$referrer = get_user_by_username($user['referrer']);

if(empty($referrer['uid']))

			$referrer = get_user_by_username($user['referrer']);

if(empty($referrer['uid']))

Zeile 622Zeile 611
			}

$user['referrer_uid'] = $referrer['uid'];

			}

$user['referrer_uid'] = $referrer['uid'];

		}

		}

		else
{
$user['referrer_uid'] = 0;

		else
{
$user['referrer_uid'] = 0;

Zeile 637Zeile 626
	* @return boolean True when valid, false when invalid.
*/
function verify_options()

	* @return boolean True when valid, false when invalid.
*/
function verify_options()

	{

	{

		global $mybb;

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

		global $mybb;

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

Zeile 685Zeile 674
			// Value out of range
$options['dstcorrection'] = (int)$options['dstcorrection'];
if($options['dstcorrection'] < 0 || $options['dstcorrection'] > 2)

			// Value out of range
$options['dstcorrection'] = (int)$options['dstcorrection'];
if($options['dstcorrection'] < 0 || $options['dstcorrection'] > 2)

			{

			{

				$options['dstcorrection'] = 0;

				$options['dstcorrection'] = 0;

			}

			}

		}

if($options['dstcorrection'] == 1)
{
$options['dst'] = 1;

		}

if($options['dstcorrection'] == 1)
{
$options['dst'] = 1;

		}

		}

		else if($options['dstcorrection'] == 0)
{
$options['dst'] = 0;

		else if($options['dstcorrection'] == 0)
{
$options['dst'] = 0;

Zeile 702Zeile 691
		if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))
{
if($mybb->settings['threadusenetstyle'])

		if($this->method == "insert" || (isset($options['threadmode']) && $options['threadmode'] != "linear" && $options['threadmode'] != "threaded"))
{
if($mybb->settings['threadusenetstyle'])

			{

			{

				$options['threadmode'] = 'threaded';
}
else
{
$options['threadmode'] = 'linear';

				$options['threadmode'] = 'threaded';
}
else
{
$options['threadmode'] = 'linear';

			}
}

			}
}


// Verify the "threads per page" option.
if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usertppoptions']))


// Verify the "threads per page" option.
if($this->method == "insert" || (array_key_exists('tpp', $options) && $mybb->settings['usertppoptions']))

Zeile 781Zeile 770
		if($regdate <= 0)
{
$regdate = TIME_NOW;

		if($regdate <= 0)
{
$regdate = TIME_NOW;

		}
return true;
}

/**

		}
return true;
}

/**

	 * Verifies if a last visit date is valid or not.
*
* @return boolean True when valid, false when invalid.

	 * Verifies if a last visit date is valid or not.
*
* @return boolean True when valid, false when invalid.

Zeile 806Zeile 795

/**
* Verifies if a last active date is valid or not.


/**
* Verifies if a last active date is valid or not.

	 *

	 *

	 * @return boolean True when valid, false when invalid.
*/
function verify_lastactive()

	 * @return boolean True when valid, false when invalid.
*/
function verify_lastactive()

	{

	{

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

$lastactive = (int)$lastactive;

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

$lastactive = (int)$lastactive;

Zeile 831Zeile 820
	function verify_away()
{
global $mybb;

	function verify_away()
{
global $mybb;





		$user = &$this->data;
// If the board does not allow "away mode" or the user is marking as not away, set defaults.
if($mybb->settings['allowaway'] == 0 || !isset($user['away']['away']) || $user['away']['away'] != 1)

		$user = &$this->data;
// If the board does not allow "away mode" or the user is marking as not away, set defaults.
if($mybb->settings['allowaway'] == 0 || !isset($user['away']['away']) || $user['away']['away'] != 1)

Zeile 841Zeile 830
			$user['away']['returndate'] = 0;
$user['away']['awayreason'] = '';
return true;

			$user['away']['returndate'] = 0;
$user['away']['awayreason'] = '';
return true;

		}

		}

		else if($user['away']['returndate'])
{
list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']);

		else if($user['away']['returndate'])
{
list($returnday, $returnmonth, $returnyear) = explode('-', $user['away']['returndate']);

Zeile 853Zeile 842

// Validate the return date lengths
$user['away']['returndate'] = substr($returnday, 0, 2).'-'.substr($returnmonth, 0, 2).'-'.substr($returnyear, 0, 4);


// Validate the return date lengths
$user['away']['returndate'] = substr($returnday, 0, 2).'-'.substr($returnmonth, 0, 2).'-'.substr($returnyear, 0, 4);

		}
return true;
}

		}
return true;
}


/**
* Verifies if a language is valid for this user or not.


/**
* Verifies if a language is valid for this user or not.

Zeile 867Zeile 856
		global $lang;

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

		global $lang;

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





		// An invalid language has been specified?
if($language != '' && !$lang->language_exists($language))
{

		// An invalid language has been specified?
if($language != '' && !$lang->language_exists($language))
{

Zeile 879Zeile 868

/**
* Verifies if a style is valid for this user or not.


/**
* Verifies if a style is valid for this user or not.

	 *

	 *

	 * @return boolean True when valid, false when invalid.
*/
function verify_style()

	 * @return boolean True when valid, false when invalid.
*/
function verify_style()

Zeile 921Zeile 910
	}

/**

	}

/**

	 * Verifies if the user timezone is valid. 

	 * Verifies if the user timezone is valid.

	 * If the timezone is invalid, the board default is used.
*
* @return boolean True when timezone was valid, false otherwise
*/
function verify_timezone()

	 * If the timezone is invalid, the board default is used.
*
* @return boolean True when timezone was valid, false otherwise
*/
function verify_timezone()

	{
$user = &$this->data;

	{
$user = &$this->data;


$timezones = get_supported_timezones();



$timezones = get_supported_timezones();


Zeile 976Zeile 965
			$this->verify_usertitle();
}
if($this->method == "insert" || array_key_exists('password', $user))

			$this->verify_usertitle();
}
if($this->method == "insert" || array_key_exists('password', $user))

		{

		{

			$this->verify_password();
}
if($this->method == "insert" || array_key_exists('usergroup', $user))
{
$this->verify_usergroup();

			$this->verify_password();
}
if($this->method == "insert" || array_key_exists('usergroup', $user))
{
$this->verify_usergroup();

		}

		}

		if($this->method == "insert" || array_key_exists('email', $user))
{
$this->verify_email();
}
if($this->method == "insert" || array_key_exists('website', $user))

		if($this->method == "insert" || array_key_exists('email', $user))
{
$this->verify_email();
}
if($this->method == "insert" || array_key_exists('website', $user))

		{

		{

			$this->verify_website();
}
if($this->method == "insert" || array_key_exists('icq', $user))
{
$this->verify_icq();

			$this->verify_website();
}
if($this->method == "insert" || array_key_exists('icq', $user))
{
$this->verify_icq();

		}

		}

		if($this->method == "insert" || (isset($user['birthday']) && is_array($user['birthday'])))
{
$this->verify_birthday();
}
if($this->method == "insert" || array_key_exists('postnum', $user))

		if($this->method == "insert" || (isset($user['birthday']) && is_array($user['birthday'])))
{
$this->verify_birthday();
}
if($this->method == "insert" || array_key_exists('postnum', $user))

		{

		{

			$this->verify_postnum();
}
if($this->method == "insert" || array_key_exists('threadnum', $user))

			$this->verify_postnum();
}
if($this->method == "insert" || array_key_exists('threadnum', $user))

Zeile 1054Zeile 1043
		if($this->method == "insert" || array_key_exists('style', $user))
{
$this->verify_style();

		if($this->method == "insert" || array_key_exists('style', $user))
{
$this->verify_style();

 
		}
if($this->method == "insert" || array_key_exists('signature', $user))
{
$this->verify_signature();

		}

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

		}

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

Zeile 1102Zeile 1095

$this->user_insert_data = array(
"username" => $db->escape_string($user['username']),


$this->user_insert_data = array(
"username" => $db->escape_string($user['username']),

			"password" => $user['saltedpw'],

			"password" => $user['password'],

			"salt" => $user['salt'],
"loginkey" => $user['loginkey'],
"email" => $db->escape_string($user['email']),

			"salt" => $user['salt'],
"loginkey" => $user['loginkey'],
"email" => $db->escape_string($user['email']),

Zeile 1195Zeile 1188
		if(is_array($pfcache))
{
foreach($pfcache as $profile_field)

		if(is_array($pfcache))
{
foreach($pfcache as $profile_field)

			{

			{

				if(array_key_exists("fid{$profile_field['fid']}", $user['user_fields']))
{
continue;

				if(array_key_exists("fid{$profile_field['fid']}", $user['user_fields']))
{
continue;

Zeile 1265Zeile 1258
		{
$this->user_update_data['username'] = $db->escape_string($user['username']);
}

		{
$this->user_update_data['username'] = $db->escape_string($user['username']);
}

		if(isset($user['saltedpw']))





		if(isset($user['password']))
{
$this->user_update_data['password'] = $user['password'];
}
if(isset($user['salt']))

		{

		{

			$this->user_update_data['password'] = $user['saltedpw'];

 
			$this->user_update_data['salt'] = $user['salt'];

			$this->user_update_data['salt'] = $user['salt'];

			$this->user_update_data['loginkey'] = $user['loginkey'];




		}
if(isset($user['loginkey']))
{
$this->user_update_data['loginkey'] = $user['loginkey'];

		}
if(isset($user['email']))
{

		}
if(isset($user['email']))
{

Zeile 1319Zeile 1318
		if(isset($user['signature']))
{
$this->user_update_data['signature'] = $db->escape_string($user['signature']);

		if(isset($user['signature']))
{
$this->user_update_data['signature'] = $db->escape_string($user['signature']);

		}

		}

		if(isset($user['website']))
{
$this->user_update_data['website'] = $db->escape_string($user['website']);
}
if(isset($user['icq']))

		if(isset($user['website']))
{
$this->user_update_data['website'] = $db->escape_string($user['website']);
}
if(isset($user['icq']))

		{

		{

			$this->user_update_data['icq'] = (int)$user['icq'];
}
if(isset($user['aim']))
{
$this->user_update_data['aim'] = $db->escape_string($user['aim']);

			$this->user_update_data['icq'] = (int)$user['icq'];
}
if(isset($user['aim']))
{
$this->user_update_data['aim'] = $db->escape_string($user['aim']);

		}

		}

		if(isset($user['yahoo']))
{
$this->user_update_data['yahoo'] = $db->escape_string($user['yahoo']);
}
if(isset($user['skype']))

		if(isset($user['yahoo']))
{
$this->user_update_data['yahoo'] = $db->escape_string($user['yahoo']);
}
if(isset($user['skype']))

		{

		{

			$this->user_update_data['skype'] = $db->escape_string($user['skype']);
}
if(isset($user['google']))
{
$this->user_update_data['google'] = $db->escape_string($user['google']);

			$this->user_update_data['skype'] = $db->escape_string($user['skype']);
}
if(isset($user['google']))
{
$this->user_update_data['google'] = $db->escape_string($user['google']);

		}

		}

		if(isset($user['bday']))
{
$this->user_update_data['birthday'] = $user['bday'];
}
if(isset($user['birthdayprivacy']))

		if(isset($user['bday']))
{
$this->user_update_data['birthday'] = $user['bday'];
}
if(isset($user['birthdayprivacy']))

		{

		{

			$this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);
}
if(isset($user['style']))
{
$this->user_update_data['style'] = (int)$user['style'];

			$this->user_update_data['birthdayprivacy'] = $db->escape_string($user['birthdayprivacy']);
}
if(isset($user['style']))
{
$this->user_update_data['style'] = (int)$user['style'];

		}

		}

		if(isset($user['timezone']))
{
$this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
}
if(isset($user['dateformat']))

		if(isset($user['timezone']))
{
$this->user_update_data['timezone'] = $db->escape_string($user['timezone']);
}
if(isset($user['dateformat']))

		{

		{

			$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);
}
if(isset($user['timeformat']))
{
$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);

			$this->user_update_data['dateformat'] = $db->escape_string($user['dateformat']);
}
if(isset($user['timeformat']))
{
$this->user_update_data['timeformat'] = $db->escape_string($user['timeformat']);

		}

		}

		if(isset($user['regip']))
{
$this->user_update_data['regip'] = $db->escape_string($user['regip']);
}
if(isset($user['language']))

		if(isset($user['regip']))
{
$this->user_update_data['regip'] = $db->escape_string($user['regip']);
}
if(isset($user['language']))

		{

		{

			$this->user_update_data['language'] = $db->escape_string($user['language']);
}
if(isset($user['away']))
{

			$this->user_update_data['language'] = $db->escape_string($user['language']);
}
if(isset($user['away']))
{

			$this->user_update_data['away'] = $user['away']['away'];

			$this->user_update_data['away'] = (int)$user['away']['away'];

			$this->user_update_data['awaydate'] = $db->escape_string($user['away']['date']);
$this->user_update_data['returndate'] = $db->escape_string($user['away']['returndate']);
$this->user_update_data['awayreason'] = $db->escape_string($user['away']['awayreason']);

			$this->user_update_data['awaydate'] = $db->escape_string($user['away']['date']);
$this->user_update_data['returndate'] = $db->escape_string($user['away']['returndate']);
$this->user_update_data['awayreason'] = $db->escape_string($user['away']['awayreason']);

Zeile 1386Zeile 1385
		if(isset($user['notepad']))
{
$this->user_update_data['notepad'] = $db->escape_string($user['notepad']);

		if(isset($user['notepad']))
{
$this->user_update_data['notepad'] = $db->escape_string($user['notepad']);

		}

		}

		if(isset($user['usernotes']))
{
$this->user_update_data['usernotes'] = $db->escape_string($user['usernotes']);
}
if(isset($user['options']) && is_array($user['options']))

		if(isset($user['usernotes']))
{
$this->user_update_data['usernotes'] = $db->escape_string($user['usernotes']);
}
if(isset($user['options']) && is_array($user['options']))

		{

		{

			foreach($user['options'] as $option => $value)
{
$this->user_update_data[$option] = $value;

			foreach($user['options'] as $option => $value)
{
$this->user_update_data[$option] = $value;

Zeile 1590Zeile 1589
		$cache->update_forumsdisplay();
$cache->update_reportedcontent();
$cache->update_awaitingactivation();

		$cache->update_forumsdisplay();
$cache->update_reportedcontent();
$cache->update_awaitingactivation();

 
		$cache->update_birthdays();


return $this->return_values;
}


return $this->return_values;
}

Zeile 1606Zeile 1606
		if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

		if($delete_uids != false)
{
$this->delete_uids = array_map('intval', (array)$delete_uids);

		



			foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])

			foreach($this->delete_uids as $key => $uid)
{
if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])

Zeile 1615Zeile 1615
					unset($this->delete_uids[$key]);
}
}

					unset($this->delete_uids[$key]);
}
}

		



			$this->delete_uids = implode(',', $this->delete_uids);
}


			$this->delete_uids = implode(',', $this->delete_uids);
}


Zeile 1651Zeile 1651
		// Delete reports made to the profile or reputation of the deleted users (i.e. made by them)
$db->delete_query('reportedcontent', "type='reputation' AND id3 IN({$this->delete_uids}) OR type='reputation' AND id2 IN({$this->delete_uids})");
$db->delete_query('reportedcontent', "type='profile' AND id IN({$this->delete_uids})");

		// Delete reports made to the profile or reputation of the deleted users (i.e. made by them)
$db->delete_query('reportedcontent', "type='reputation' AND id3 IN({$this->delete_uids}) OR type='reputation' AND id2 IN({$this->delete_uids})");
$db->delete_query('reportedcontent', "type='profile' AND id IN({$this->delete_uids})");





		// Update the reports made by the deleted users by setting the uid to 0
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


		// Update the reports made by the deleted users by setting the uid to 0
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


Zeile 1662Zeile 1662
			remove_avatars($uid);
}
}

			remove_avatars($uid);
}
}





	/**
* Provides a method to delete an users posts and threads
*
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_posts($delete_uids=false)

	/**
* Provides a method to delete an users posts and threads
*
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function)
*/
function delete_posts($delete_uids=false)

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{

	{
global $db, $plugins, $mybb;

if($delete_uids != false)
{

			$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)

			$this->delete_uids = array_map('intval', (array)$delete_uids);

foreach($this->delete_uids as $key => $uid)

Zeile 1684Zeile 1684
					unset($this->delete_uids[$key]);
}
}

					unset($this->delete_uids[$key]);
}
}





			$this->delete_uids = implode(',', $this->delete_uids);
}

require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();

			$this->delete_uids = implode(',', $this->delete_uids);
}

require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();


$plugins->run_hooks('datahandler_user_delete_posts', $this);

if(empty($this->delete_uids))
{


$plugins->run_hooks('datahandler_user_delete_posts', $this);

if(empty($this->delete_uids))
{

			return;
}


			return;
}


Zeile 1738Zeile 1738
			}

$this->delete_uids = implode(',', $this->delete_uids);

			}

$this->delete_uids = implode(',', $this->delete_uids);

		}

		}


$update = array(
"website" => "",


$update = array(
"website" => "",

Zeile 1759Zeile 1759
			"avatar" => "",
'avatardimensions' => '',
'avatartype' => ''

			"avatar" => "",
'avatardimensions' => '',
'avatartype' => ''

		);


		);


		if($gid > 0)
{
$update["usergroup"] = (int)$gid;

		if($gid > 0)
{
$update["usergroup"] = (int)$gid;

Zeile 1771Zeile 1771
		if(empty($this->delete_uids))
{
return;

		if(empty($this->delete_uids))
{
return;

		}

		}


$db->update_query("users", $update, "uid IN({$this->delete_uids})");
$db->delete_query('userfields', "ufid IN({$this->delete_uids})");


$db->update_query("users", $update, "uid IN({$this->delete_uids})");
$db->delete_query('userfields', "ufid IN({$this->delete_uids})");

Zeile 1779Zeile 1779
		// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)

		// Remove any of the user(s) uploaded avatars
require_once MYBB_ROOT.'inc/functions_upload.php';
foreach(explode(',', $this->delete_uids) as $uid)

		{

		{

			remove_avatars($uid);
}

			remove_avatars($uid);
}

 
	}

public function verify_signature()
{
global $mybb, $parser;

if(!isset($parser))
{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

$parser_options = array(
'allow_html' => $mybb->settings['sightml'],
'filter_badwords' => 1,
'allow_mycode' => $mybb->settings['sigmycode'],
'allow_smilies' => $mybb->settings['sigsmilies'],
'allow_imgcode' => $mybb->settings['sigimgcode'],
"filter_badwords" => 1
);

$parsed_sig = $parser->parse_message($this->data['signature'], $parser_options);

if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) &&
substr_count($parsed_sig, "<img") > 0) ||
(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages'])
)
{
$imgsallowed = 0;

if($mybb->settings['sigimgcode'] == 1)
{
$imgsallowed = $mybb->settings['maxsigimages'];
}

$this->set_error('too_many_sig_images2', array($imgsallowed));
}

if($mybb->settings['sigcountmycode'] == 0)
{
$parsed_sig = $parser->text_parse_message($this->data['signature']);
}
else
{
$parsed_sig = $this->data['signature'];
}

$parsed_sig = preg_replace("#\s#", "", $parsed_sig);
$sig_length = my_strlen($parsed_sig);

if($sig_length > $mybb->settings['siglength'])
{
$this->set_error('sig_too_long', array($mybb->settings['siglength']));

if($sig_length - $mybb->settings['siglength'] > 1)
{
$this->set_error('sig_remove_chars_plural', array($sig_length-$mybb->settings['siglength']));
}
else
{
$this->set_error('sig_remove_chars_singular');
}
}

if(count($this->get_errors()) > 0)
{
return false;
}
return true;

	}
}

	}
}