summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kartashoff <gluke@php.net>2005-01-23 15:01:20 +0000
committerSergey Kartashoff <gluke@php.net>2005-01-23 15:01:20 +0000
commit618b7c267c5152e3f4e93072f01cf5b5d0cf8372 (patch)
treecea685b2c8263b00b734bca658607f90b76a5a04
parent60f5e66aa94afc7d1c26c4613781a55e2477e5e7 (diff)
downloadphp-git-618b7c267c5152e3f4e93072f01cf5b5d0cf8372.tar.gz
- A bug in mnogosearch module in ispell loading code was fixed
-rw-r--r--ext/mnogosearch/php_mnogo.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/mnogosearch/php_mnogo.c b/ext/mnogosearch/php_mnogo.c
index a54b8765a3..4e9e0f7bdc 100644
--- a/ext/mnogosearch/php_mnogo.c
+++ b/ext/mnogosearch/php_mnogo.c
@@ -1279,6 +1279,18 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
UdmSortAffixes(Agent->Conf);
}
#endif
+#else
+ if(Agent->Conf->Spells.nitems && Agent->Conf->Affixes.nitems) {
+ char *err= Agent->Conf->errstr;
+ int flags= strcasecmp(UdmVarListFindStr(&Agent->Conf->Vars,
+ "IspellUsePrefixes","no"),"no");
+ flags= flags ? 0 : UDM_SPELL_NOPREFIX;
+ if (UdmSpellListListLoad(&Agent->Conf->Spells, err, 128) ||
+ UdmAffixListListLoad(&Agent->Conf->Affixes, flags, err, 128)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error loading ispell data");
+ RETURN_FALSE;
+ }
+ }
#endif
}
@@ -2000,7 +2012,7 @@ DLEXPORT PHP_FUNCTION(udm_hash32)
Perform search */
DLEXPORT PHP_FUNCTION(udm_find)
{
- pval ** yyquery, ** yyagent;
+ pval ** yyquery=NULL, ** yyagent;
UDM_RESULT * Res;
UDM_AGENT * Agent;
int id=-1;
@@ -2031,6 +2043,9 @@ DLEXPORT PHP_FUNCTION(udm_find)
if ((Res=UdmFind(Agent,UdmTolower(Z_STRVAL_PP(yyquery),Agent->charset)))) {
#else
#if UDM_VERSION_ID >= 30213
+ if ((yyquery) && (strlen(Z_STRVAL_PP(yyquery))))
+ UdmVarListReplaceStr(&Agent->Conf->Vars, "q",
+ Z_STRVAL_PP(yyquery));
if ((Res=UdmFind(Agent))) {
#else
if ((Res=UdmFind(Agent,Z_STRVAL_PP(yyquery)))) {