mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-06 16:53:34 +02:00
fixes #2161 in search, do not consider dot character alone as a splitter
This commit is contained in:
@@ -1705,12 +1705,14 @@ function split_allwords($raw_allwords)
|
|||||||
{
|
{
|
||||||
$words = null;
|
$words = null;
|
||||||
|
|
||||||
$raw_allwords = trim($raw_allwords);
|
// we specify the list of characters to trim, to add the ".". We don't want to split words
|
||||||
|
// on "." but on ". ", and we have to deal with trailing dots.
|
||||||
|
$raw_allwords = trim($raw_allwords, " \n\r\t\v\x00.");
|
||||||
|
|
||||||
if (!preg_match('/^\s*$/', $raw_allwords))
|
if (!preg_match('/^\s*$/', $raw_allwords))
|
||||||
{
|
{
|
||||||
$drop_char_match = array(';','&','(',')','<','>','`','\'','"','|',',','@','?','%','.','[',']','{','}',':','\\','/','=','\'','!','*');
|
$drop_char_match = array(';','&','(',')','<','>','`','\'','"','|',',','@','?','%','. ','[',']','{','}',':','\\','/','=','\'','!','*');
|
||||||
$drop_char_replace = array(' ',' ',' ',' ',' ',' ', '', '', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','' , ' ',' ',' ', ' ',' ');
|
$drop_char_replace = array(' ',' ',' ',' ',' ',' ', '', '', ' ',' ',' ',' ',' ',' ',' ' ,' ',' ',' ',' ',' ','' , ' ',' ',' ', ' ',' ');
|
||||||
|
|
||||||
// Split words
|
// Split words
|
||||||
$words = array_unique(
|
$words = array_unique(
|
||||||
|
|||||||
Reference in New Issue
Block a user