cvs: php4(PHP_4_3) /ext/pspell pspell.c
| From: | Jay Smith | Date: | Wed, 21 May 2003 23:08:27 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/pspell pspell.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-21201@lists.php.net to get a copy of this message | ||
jay Wed May 21 19:08:27 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/pspell pspell.c
Log:
MFH
Index: php4/ext/pspell/pspell.c
diff -u php4/ext/pspell/pspell.c:1.28.8.1 php4/ext/pspell/pspell.c:1.28.8.2
--- php4/ext/pspell/pspell.c:1.28.8.1 Tue Dec 31 11:35:14 2002
+++ php4/ext/pspell/pspell.c Wed May 21 19:08:27 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pspell.c,v 1.28.8.1 2002/12/31 16:35:14 sebastian Exp $ */
+/* $Id: pspell.c,v 1.28.8.2 2003/05/21 23:08:27 jay Exp $ */
#define IS_EXT_MODULE
@@ -288,6 +288,12 @@
convert_to_long_ex(conf);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(conf), &type);
+
+ if (config == NULL || type != le_pspell_config) {
+ php_error(E_WARNING, "%d is not a PSPELL config index", Z_LVAL_PP(conf));
+ RETURN_FALSE;
+ }
+
ret = new_pspell_manager(config);
if(pspell_error_number(ret) != 0){
@@ -319,7 +325,7 @@
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -351,13 +357,11 @@
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
- if (array_init(return_value) == FAILURE){
- RETURN_FALSE;
- }
+ array_init(return_value);
wl = pspell_manager_suggest(manager, Z_STRVAL_PP(word));
if(wl){
@@ -392,7 +396,7 @@
convert_to_string_ex(corr);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -424,7 +428,7 @@
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -461,7 +465,7 @@
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -497,7 +501,7 @@
convert_to_long_ex(scin);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -528,7 +532,7 @@
convert_to_long_ex(scin);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
+ php_error(E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -611,7 +615,7 @@
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
+ php_error(E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@@ -640,7 +644,7 @@
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
+ php_error(E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@@ -682,7 +686,7 @@
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
+ php_error(E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@@ -728,7 +732,7 @@
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
+ php_error(E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@@ -757,7 +761,7 @@
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
+ php_error(E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@@ -788,7 +792,7 @@
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
+ php_error(E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}