cvs: /php4/ext/standard string.c
| From: | Thies C. Arntzen | Date: | Wed, 22 Mar 2000 08:14:30 +0000 |
| Subject: | cvs: /php4/ext/standard string.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12478@lists.php.net to get a copy of this message | ||
thies Wed Mar 22 00:14:30 2000 EDT
Modified files:
/php4/ext/standard string.c
Log:
@- stristr() no longer modifies it's arguments. (Thies)
fix #3890
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.102 php4/ext/standard/string.c:1.103
--- php4/ext/standard/string.c:1.102 Thu Feb 24 02:11:42 2000
+++ php4/ext/standard/string.c Wed Mar 22 00:14:00 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.102 2000/02/24 10:11:42 eschmid Exp $ */
+/* $Id: string.c,v 1.103 2000/03/22 08:14:00 thies Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -579,6 +579,9 @@
FAILURE) {
WRONG_PARAM_COUNT;
}
+
+ SEPARATE_ZVAL(haystack);
+ SEPARATE_ZVAL(needle);
convert_to_string_ex(haystack);
if ((*needle)->type == IS_STRING) {
@@ -586,12 +589,14 @@
php_error(E_WARNING,"Empty delimiter");
RETURN_FALSE;
}
+
found = php_stristr((*haystack)->value.str.val, (*needle)->value.str.val,
(*haystack)->value.str.len, (*needle)->value.str.len);
} else {
convert_to_long_ex(needle);
needle_char[0] = tolower((char) (*needle)->value.lval);
needle_char[1] = '\0';
+
found = php_stristr((*haystack)->value.str.val, needle_char,
(*haystack)->value.str.len, 1);
}