diff --git a/fts.php b/fts.php index d1c4a36..a4b38c3 100644 --- a/fts.php +++ b/fts.php @@ -365,11 +365,14 @@ class fts if ($end === false) $end = strlen ($query); $nbchars = $end - $offset; - if ($debug) echo "WORD FOUND (Start $offset with $nbchars chars)\n"; - $token = substr ($query, $offset, $nbchars); - $tokens[] = $token; - $sentences[] = false; - $minuses[] = $minus; + if ($nbchars > 0) + { + if ($debug) echo "WORD FOUND (Start $offset with $nbchars chars)\n"; + $token = substr ($query, $offset, $nbchars); + $tokens[] = $token; + $sentences[] = false; + $minuses[] = $minus; + } $offset = $end + 1; } if ($debug) print_r ($tokens);