Version 3.4.8
This commit is contained in:
1 parent
b45ea0dffb
commit
c603205a25
1398 files changed
+36675
-31023
No files matched your search
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* IP.Board v3.4.8
|
||||
* Global Search
|
||||
* Last Updated: $Date: 2012-12-03 14:03:02 -0500 (Mon, 03 Dec 2012) $
|
||||
* Last Updated: $Date: 2014-10-30 14:22:29 -0400 (Thu, 30 Oct 2014) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: AndyMillne $
|
||||
* @author $Author: rashbrook $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11673 $
|
||||
* @version $Rev: 12558 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -208,18 +208,32 @@ class search_engine
|
||||
}
|
||||
|
||||
/* Remove some formatting */
|
||||
/* InnoDB Fulltext throws a syntax error if there is a + or - at the end of the search string */
|
||||
/* @see http://stackoverflow.com/a/25972465/3113864 */
|
||||
//$search_term = str_replace( array( '|', '\\', '/' ), '', $search_term );
|
||||
// | is an OR operator for sphinx - don't want to block globally
|
||||
$search_term = str_replace( array( '\\', '/' ), '', trim( $search_term ) );
|
||||
|
||||
|
||||
/* got some bullean to do? */
|
||||
if ( $isBoolean AND strstr( $search_term, ' ' ) AND ! strstr( $search_term, '"' ) )
|
||||
{
|
||||
$cleaned_term = '';
|
||||
foreach( explode( ' ', $search_term ) AS $term )
|
||||
{
|
||||
$cleaned_term .= trim( $term, '+-()<>@~' ) . ' ';
|
||||
}
|
||||
|
||||
$search_term = trim( $cleaned_term );
|
||||
|
||||
if ( $andor == 'and' )
|
||||
{
|
||||
$search_term = '+' . preg_replace( '/\s+(?!-|~)/', " +", $search_term );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$search_term = trim( $search_term, '+-()<>@~' );
|
||||
}
|
||||
|
||||
return array( 'search_term' => $search_term, 'removed' => $removedTerms );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user