cvs: php4 / NEWS /ext/pcre php_pcre.c
| From: | Andrei Zmievski | Date: | Tue, 15 Jan 2002 15:40:32 +0000 |
| Subject: | cvs: php4 / NEWS /ext/pcre php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9066@lists.php.net to get a copy of this message | ||
andrei Tue Jan 15 10:40:32 2002 EDT
Modified files:
/php4 NEWS
/php4/ext/pcre php_pcre.c
Log:
- Fixed a bug with matching string containing null bytes.
Index: php4/NEWS
diff -u php4/NEWS:1.848 php4/NEWS:1.849
--- php4/NEWS:1.848 Sun Jan 13 20:13:34 2002
+++ php4/NEWS Tue Jan 15 10:40:30 2002
@@ -1,6 +1,8 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, Version 4.2.0-dev
+- Fixed a bug in preg_match()/preg_match_all() when matching strings containing
+ null bytes. (Andrei)
- Added xpath_register_ns() function.
It makes possible to issue XPath queries with namespaces
like for example: "//namespace:sampletag" (Chris Jarecki)
Index: php4/ext/pcre/php_pcre.c
diff -u php4/ext/pcre/php_pcre.c:1.115 php4/ext/pcre/php_pcre.c:1.116
--- php4/ext/pcre/php_pcre.c:1.115 Fri Dec 21 22:04:14 2001
+++ php4/ext/pcre/php_pcre.c Tue Jan 15 10:40:31 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.c,v 1.115 2001/12/22 03:04:14 zeev Exp $ */
+/* $Id: php_pcre.c,v 1.116 2002/01/15 15:40:31 andrei Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -440,7 +440,8 @@
if (subpats_order_val == PREG_PATTERN_ORDER) {
/* For each subpattern, insert it into the appropriate array. */
for (i = 0; i < count; i++) {
- add_next_index_string(match_sets[i], (char *)stringlist[i], 1);
+ add_next_index_stringl(match_sets[i], (char *)stringlist[i],
+ offsets[(i<<1)+1] - offsets[i<<1], 1);
}
/*
* If the number of captured subpatterns on this run is
@@ -460,7 +461,8 @@
/* Add all the subpatterns to it */
for (i = 0; i < count; i++) {
- add_next_index_string(result_set, (char *)stringlist[i], 1);
+ add_next_index_stringl(result_set, (char *)stringlist[i],
+ offsets[(i<<1)+1] - offsets[i<<1], 1);
}
/* And add it to the output array */
zend_hash_next_index_insert(Z_ARRVAL_PP(subpats), &result_set,
@@ -470,7 +472,8 @@
else { /* single pattern matching */
/* For each subpattern, insert it into the subpatterns array. */
for (i = 0; i < count; i++) {
- add_next_index_string((*subpats), (char *)stringlist[i], 1);
+ add_next_index_stringl((*subpats), (char *)stringlist[i],
+ offsets[(i<<1)+1] - offsets[i<<1], 1);
}
}