diff options
author | matthiasgrimm <matthiasgrimm@users.sourceforge.net> | 2005-06-04 23:20:26 +0200 |
---|---|---|
committer | matthiasgrimm <matthiasgrimm@users.sourceforge.net> | 2005-06-04 23:20:26 +0200 |
commit | 248a73214063d2fe47787c8c4aa292777cddb12b (patch) | |
tree | cf76d6a53e8f98159c5ec40f7817dde74da0e620 | |
parent | 4735a94937a223969f852e122716d4a56e141afd (diff) | |
download | rpg-248a73214063d2fe47787c8c4aa292777cddb12b.tar.gz rpg-248a73214063d2fe47787c8c4aa292777cddb12b.tar.bz2 |
extended search fix
This patch fixes a bug in the search code and did some
optimizations. Furtheron queries with only excluded
words will be rejected because they won't produce
usable output and waste only time.
darcs-hash:20050604212026-7ef76-7a096791875407859eae390290165e4b6e7ef082.gz
-rw-r--r-- | inc/search.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/inc/search.php b/inc/search.php index 654f1ab69..b96f2444d 100644 --- a/inc/search.php +++ b/inc/search.php @@ -317,6 +317,9 @@ function search_fulltext(&$data,$base,$file,$type,$lvl,$opts){ break; } } + + // a search without any posword is useless + if (!count($poswords)) return true; $req = count($poswords) ? $reg .= '^(?=.*?'.join(')(?=.*?',$poswords).')' : '^'; $reg .= count($negwords) ? '((?!'.join('|',$negwords).').)*$' : '.*$'; |