Fossil SCM
Do not allow the "." character inside of FTS5 search strings.
Commit
8a7609b11e31dbfe5ad5d77de762655c09d4783bb50706b38796ca03b413225c
Parent
a1178d57340baa9…
1 file changed
+1
-1
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -926,11 +926,11 @@ | ||
| 926 | 926 | static const char *zSnippetCall; |
| 927 | 927 | if( srchFlags==0 ) return; |
| 928 | 928 | sqlite3_create_function(g.db, "rank", 1, SQLITE_UTF8|SQLITE_INNOCUOUS, 0, |
| 929 | 929 | search_rank_sqlfunc, 0, 0); |
| 930 | 930 | for(i=0; zPat[i]; i++){ |
| 931 | - if( zPat[i]=='-' || zPat[i]=='"' ) zPat[i] = ' '; | |
| 931 | + if( zPat[i]=='-' || zPat[i]=='"' zPat[i]=='.' ) zPat[i] = ' '; | |
| 932 | 932 | } |
| 933 | 933 | blob_init(&sql, 0, 0); |
| 934 | 934 | if( search_index_type(0)==4 ){ |
| 935 | 935 | /* If this repo is still using the legacy FTS4 search index, then |
| 936 | 936 | ** the snippet() function is slightly different */ |
| 937 | 937 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -926,11 +926,11 @@ | |
| 926 | static const char *zSnippetCall; |
| 927 | if( srchFlags==0 ) return; |
| 928 | sqlite3_create_function(g.db, "rank", 1, SQLITE_UTF8|SQLITE_INNOCUOUS, 0, |
| 929 | search_rank_sqlfunc, 0, 0); |
| 930 | for(i=0; zPat[i]; i++){ |
| 931 | if( zPat[i]=='-' || zPat[i]=='"' ) zPat[i] = ' '; |
| 932 | } |
| 933 | blob_init(&sql, 0, 0); |
| 934 | if( search_index_type(0)==4 ){ |
| 935 | /* If this repo is still using the legacy FTS4 search index, then |
| 936 | ** the snippet() function is slightly different */ |
| 937 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -926,11 +926,11 @@ | |
| 926 | static const char *zSnippetCall; |
| 927 | if( srchFlags==0 ) return; |
| 928 | sqlite3_create_function(g.db, "rank", 1, SQLITE_UTF8|SQLITE_INNOCUOUS, 0, |
| 929 | search_rank_sqlfunc, 0, 0); |
| 930 | for(i=0; zPat[i]; i++){ |
| 931 | if( zPat[i]=='-' || zPat[i]=='"' zPat[i]=='.' ) zPat[i] = ' '; |
| 932 | } |
| 933 | blob_init(&sql, 0, 0); |
| 934 | if( search_index_type(0)==4 ){ |
| 935 | /* If this repo is still using the legacy FTS4 search index, then |
| 936 | ** the snippet() function is slightly different */ |
| 937 |