Vergleich inc/functions_search.php - 1.8.13 - 1.8.21

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 125Zeile 125
		$pwverified = 1;
if($forum['password'] != '')
{

		$pwverified = 1;
if($forum['password'] != '')
{

			if($mybb->cookies['forumpass'][$forum['fid']] !== md5($mybb->user['uid'].$forum['password']))

			if(!isset($mybb->cookies['forumpass'][$forum['fid']]) || !my_hash_equals($mybb->cookies['forumpass'][$forum['fid']], md5($mybb->user['uid'].$forum['password'])))

			{
$pwverified = 0;
}

			{
$pwverified = 0;
}

Zeile 272Zeile 272
	// Separate braces for further processing
$keywords = preg_replace("#((\+|-|<|>|~)?\(|\))#s", " $1 ", $keywords);
$keywords = preg_replace("#\s+#s", " ", $keywords);

	// Separate braces for further processing
$keywords = preg_replace("#((\+|-|<|>|~)?\(|\))#s", " $1 ", $keywords);
$keywords = preg_replace("#\s+#s", " ", $keywords);

 
	
global $mybb;

$min_word_length = (int) $mybb->settings['minsearchword'];
if($min_word_length <= 0)
{
$min_word_length = 3;
}
$min_word_length -= 1;

// Replaces less than 3 characters
$keywords = preg_replace("/(\b.{1,{$min_word_length}})(\s)|(\b.{1,{$min_word_length}}$)/", '$2', $keywords);
// Collapse multiple spaces
$keywords = preg_replace('/(\s)+/', '$1', $keywords);
$keywords = trim($keywords);


$words = array(array());



$words = array(array());


Zeile 302Zeile 317
				// Split words
$split_words = preg_split("#\s{1,}#", $phrase, -1);
if(!is_array($split_words))

				// Split words
$split_words = preg_split("#\s{1,}#", $phrase, -1);
if(!is_array($split_words))

				{

				{

					continue;
}
if(!$inquote)

					continue;
}
if(!$inquote)

Zeile 403Zeile 418

$keywords = implode(' ', $words[0]);
return $keywords;


$keywords = implode(' ', $words[0]);
return $keywords;

}

/* Database engine specific search functions */

/**
* Perform a thread and post search under MySQL or MySQLi
*
* @param array $search Array of search data
* @return array Array of search data with results mixed in

}

/* Database engine specific search functions */

/**
* Perform a thread and post search under MySQL or MySQLi
*
* @param array $search Array of search data
* @return array Array of search data with results mixed in

 */
function privatemessage_perform_search_mysql($search)
{

 */
function privatemessage_perform_search_mysql($search)
{

Zeile 498Zeile 513
								elseif($search['subject'] && !$search['message'] && $subject_lookin == " AND (")
{
// Just in a subject?

								elseif($search['subject'] && !$search['message'] && $subject_lookin == " AND (")
{
// Just in a subject?

									continue;
}

									continue;
}

								elseif(!$search['subject'] && $search['message'] && $message_lookin == " {$string} (")
{
// Just in a message?

								elseif(!$search['subject'] && $search['message'] && $message_lookin == " {$string} (")
{
// Just in a message?

Zeile 547Zeile 562
					if($search['message'] == 1)
{
$message_lookin .= " $boolean {$mfield} LIKE '%{$phrase}%'";

					if($search['message'] == 1)
{
$message_lookin .= " $boolean {$mfield} LIKE '%{$phrase}%'";

					}
$boolean = 'AND';
}

// Check to see if we have any search terms and not a malformed SQL string

					}
$boolean = 'AND';
}

// Check to see if we have any search terms and not a malformed SQL string

				$error = false;
if($search['subject'] && $search['message'] && $subject_lookin == " AND (")
{

				$error = false;
if($search['subject'] && $search['message'] && $subject_lookin == " AND (")
{

Zeile 698Zeile 713
		$statussql = implode("OR", $statussql);
$searchsql .= $statussql.")";
}

		$statussql = implode("OR", $statussql);
$searchsql .= $statussql.")";
}

 

$limitsql = "";
if((int)$mybb->settings['searchhardlimit'] > 0)
{
$limitsql = " LIMIT ".(int)$mybb->settings['searchhardlimit'];
}
$searchsql .= $limitsql;


// Run the search
$pms = array();


// Run the search
$pms = array();

Zeile 764Zeile 786
		{
$string = "AND";
if($search['name'] == 1)

		{
$string = "AND";
if($search['name'] == 1)

			{

			{

				$string = "OR";
$name_lookin = " AND (";
}

				$string = "OR";
$name_lookin = " AND (";
}

Zeile 814Zeile 836
									// Just in a document?
continue;
}

									// Just in a document?
continue;
}

							}

							}


$boolean = $word;
}


$boolean = $word;
}

Zeile 830Zeile 852
							}
// Add terms to search query
if($search['name'] == 1)

							}
// Add terms to search query
if($search['name'] == 1)

							{

							{

								$name_lookin .= " $boolean {$nfield} LIKE '%{$word}%'";

								$name_lookin .= " $boolean {$nfield} LIKE '%{$word}%'";

							}

							}

							if($search['document'] == 1)
{
$document_lookin .= " $boolean {$dfield} LIKE '%{$word}%'";

							if($search['document'] == 1)
{
$document_lookin .= " $boolean {$dfield} LIKE '%{$word}%'";

Zeile 845Zeile 867
				{
$phrase = str_replace(array("+", "-", "*"), '', trim($phrase));
if(my_strlen($phrase) < $mybb->settings['minsearchword'])

				{
$phrase = str_replace(array("+", "-", "*"), '', trim($phrase));
if(my_strlen($phrase) < $mybb->settings['minsearchword'])

					{

					{

						$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);
}

						$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);
}

Zeile 908Zeile 930

// If we're looking in both, then find matches in either the name or the document
if($search['name'] == 1 && $search['document'] == 1)


// If we're looking in both, then find matches in either the name or the document
if($search['name'] == 1 && $search['document'] == 1)

			{

			{

				$searchsql .= " AND ({$nfield} LIKE '%{$keywords}%' OR {$dfield} LIKE '%{$keywords}%')";
}
else

				$searchsql .= " AND ({$nfield} LIKE '%{$keywords}%' OR {$dfield} LIKE '%{$keywords}%')";
}
else

Zeile 924Zeile 946
				}
}
}

				}
}
}

	}

	}


// Run the search
$helpdocs = array();


// Run the search
$helpdocs = array();

Zeile 956Zeile 978
	global $mybb, $db, $lang, $cache;

$keywords = clean_keywords($search['keywords']);

	global $mybb, $db, $lang, $cache;

$keywords = clean_keywords($search['keywords']);

	if(!$keywords && !$search['author'])
{
error($lang->error_nosearchterms);
}

 

if($mybb->settings['minsearchword'] < 1)
{


if($mybb->settings['minsearchword'] < 1)
{

Zeile 1110Zeile 1128
				default:
$field = 'LOWER(username)';
break;

				default:
$field = 'LOWER(username)';
break;

			}

			}

			$query = $db->simple_select("users", "uid", "{$field} LIKE '%".$db->escape_string_like($search['author'])."%'");
while($user = $db->fetch_array($query))
{

			$query = $db->simple_select("users", "uid", "{$field} LIKE '%".$db->escape_string_like($search['author'])."%'");
while($user = $db->fetch_array($query))
{

Zeile 1386Zeile 1404
	global $mybb, $db, $lang;

$keywords = clean_keywords_ft($search['keywords']);

	global $mybb, $db, $lang;

$keywords = clean_keywords_ft($search['keywords']);

	if(!$keywords && !$search['author'])
{
error($lang->error_nosearchterms);
}


	





	// Attempt to determine minimum word length from MySQL for fulltext searches
$query = $db->query("SHOW VARIABLES LIKE 'ft_min_word_len';");
$min_length = $db->fetch_field($query, 'Value');

	// Attempt to determine minimum word length from MySQL for fulltext searches
$query = $db->query("SHOW VARIABLES LIKE 'ft_min_word_len';");
$min_length = $db->fetch_field($query, 'Value');