Vergleich inc/functions_search.php - 1.4.8 - 1.4.11

  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: functions_search.php 4384 2009-06-19 11:49:42Z Tomm $

 * $Id: functions_search.php 4554 2009-11-29 00:23:57Z RyanGordon $

 */

/**

 */

/**

Zeile 154Zeile 154
		}
}
$unsearchable = $unsearchableforums;

		}
}
$unsearchable = $unsearchableforums;

 
	
// Get our unsearchable password protected forums
$pass_protected_forums = get_password_protected_forums();

if($unsearchable && $pass_protected_forums)
{
$unsearchable .= ",";
}

if($pass_protected_forums)
{
$unsearchable .= implode(",", $pass_protected_forums);
}


	return $unsearchable;

	return $unsearchable;

 
}

/**
* Build a array list of the forums this user cannot search due to password protection
*
* @param int the fids to check (leave null to check all forums)
* @return return a array list of password protected forums the user cannot search
*/
function get_password_protected_forums($fids=array())
{
global $forum_cache, $mybb;

if(!is_array($fids))
{
return false;
}

if(!is_array($forum_cache))
{
$forum_cache = cache_forums();
if(!$forum_cache)
{
return false;
}
}

if(empty($fids))
{
$fids = array_keys($forum_cache);
}

$pass_fids = array();
foreach($fids as $fid)
{
if(empty($forum_cache[$fid]['password']))
{
continue;
}

if(md5($mybb->user['uid'].$forum_cache[$fid]['password']) != $mybb->cookies['forumpass'][$fid])
{
$pass_fids[] = $fid;
$child_list = get_child_list($fid);
}

if(is_array($child_list))
{
$pass_fids = array_merge($pass_fids, $child_list);
}
}
return array_unique($pass_fids);

}

/**
* Clean search keywords and make them safe for querying

}

/**
* Clean search keywords and make them safe for querying

 *
* @param string The keywords to be cleaned

 *
* @param string The keywords to be cleaned

 * @return string The cleaned keywords
*/
function clean_keywords($keywords)

 * @return string The cleaned keywords
*/
function clean_keywords($keywords)

{
$keywords = my_strtolower($keywords);
$keywords = str_replace("%", "\\%", $keywords);

{
$keywords = my_strtolower($keywords);
$keywords = str_replace("%", "\\%", $keywords);

	$keywords = preg_replace("#\*{2,}#s", "*", $keywords);
$keywords = str_replace("*", "%", $keywords);
$keywords = preg_replace("#([\[\]\|\.\,:'])#s", " ", $keywords);

	$keywords = preg_replace("#\*{2,}#s", "*", $keywords);
$keywords = str_replace("*", "%", $keywords);
$keywords = preg_replace("#([\[\]\|\.\,:'])#s", " ", $keywords);

Zeile 202Zeile 267
	$keywords = preg_replace("#\*{2,}#s", "*", $keywords);
$keywords = preg_replace("#([\[\]\|\.\,:])#s", " ", $keywords);
$keywords = preg_replace("#\s+#s", " ", $keywords);

	$keywords = preg_replace("#\*{2,}#s", "*", $keywords);
$keywords = preg_replace("#([\[\]\|\.\,:])#s", " ", $keywords);
$keywords = preg_replace("#\s+#s", " ", $keywords);





	
$words = array();


	if(my_strpos($keywords, "\"") !== false)
{
$inquote = false;

	if(my_strpos($keywords, "\"") !== false)
{
$inquote = false;