summaryrefslogtreecommitdiff
path: root/ext/spl
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:48 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:48 -0400
commiteddbbea4325e602ddc87c545531609132d4f0e3b (patch)
treef0994206a7e0a6251be7cc6729ba480f0c8729c2 /ext/spl
parent2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (diff)
downloadphp-eddbbea4325e602ddc87c545531609132d4f0e3b.tar.gz
Imported Upstream version 5.2.3upstream/5.2.3
Diffstat (limited to 'ext/spl')
-rwxr-xr-xext/spl/php_spl.c20
-rwxr-xr-xext/spl/spl_iterators.c6
-rwxr-xr-xext/spl/spl_iterators.h3
-rwxr-xr-xext/spl/tests/bug33136.phpt2
-rwxr-xr-xext/spl/tests/bug36287.phpt2
5 files changed, 24 insertions, 9 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 5de79d47d..3f1ed7995 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_spl.c,v 1.52.2.28.2.15 2007/04/06 16:00:08 helly Exp $ */
+/* $Id: php_spl.c,v 1.52.2.28.2.17 2007/05/19 18:40:27 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -45,6 +45,8 @@ ZEND_GET_MODULE(spl)
ZEND_DECLARE_MODULE_GLOBALS(spl)
+#define SPL_DEFAULT_FILE_EXTENSIONS ".inc,.php"
+
/* {{{ spl_functions_none
*/
zend_function_entry spl_functions_none[] = {
@@ -271,7 +273,11 @@ PHP_FUNCTION(spl_autoload)
RETURN_FALSE;
}
- copy = pos1 = estrndup(file_exts, file_exts_len);
+ if (file_exts == NULL) { /* autoload_extensions is not intialzed, set to defaults */
+ copy = pos1 = estrndup(SPL_DEFAULT_FILE_EXTENSIONS, sizeof(SPL_DEFAULT_FILE_EXTENSIONS)-1);
+ } else {
+ copy = pos1 = estrndup(file_exts, file_exts_len);
+ }
lc_name = zend_str_tolower_dup(class_name, class_name_len);
while(pos1 && *pos1 && !EG(exception)) {
EG(return_value_ptr_ptr) = original_return_value;
@@ -328,7 +334,11 @@ PHP_FUNCTION(spl_autoload_extensions)
SPL_G(autoload_extensions_len) = file_exts_len;
}
- RETURN_STRINGL(SPL_G(autoload_extensions), SPL_G(autoload_extensions_len), 1);
+ if (SPL_G(autoload_extensions) == NULL) {
+ RETURN_STRINGL(SPL_DEFAULT_FILE_EXTENSIONS, sizeof(SPL_DEFAULT_FILE_EXTENSIONS) - 1, 1);
+ } else {
+ RETURN_STRINGL(SPL_G(autoload_extensions), SPL_G(autoload_extensions_len), 1);
+ }
} /* }}} */
typedef struct {
@@ -717,8 +727,8 @@ PHP_MINIT_FUNCTION(spl)
PHP_RINIT_FUNCTION(spl) /* {{{ */
{
- SPL_G(autoload_extensions) = estrndup(".inc,.php", sizeof(".inc,.php")-1);
- SPL_G(autoload_extensions_len) = sizeof(".inc,.php")-1;
+ SPL_G(autoload_extensions) = NULL;
+ SPL_G(autoload_extensions_len) = 0;
SPL_G(autoload_functions) = NULL;
return SUCCESS;
} /* }}} */
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 8534d313b..6426e2d8a 100755
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.73.2.30.2.27 2007/03/04 14:01:06 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.30.2.28 2007/05/11 00:15:25 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1426,6 +1426,10 @@ SPL_METHOD(RegexIterator, accept)
}
}
+ if (intern->u.regex.flags & REGIT_INVERTED) {
+ RETVAL_BOOL(Z_LVAL_P(return_value));
+ }
+
if (use_copy) {
efree(subject);
}
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 7c5031241..26c21693d 100755
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.h,v 1.18.2.7.2.11 2007/02/08 22:17:40 helly Exp $ */
+/* $Id: spl_iterators.h,v 1.18.2.7.2.12 2007/05/11 00:15:25 helly Exp $ */
#ifndef SPL_ITERATORS_H
#define SPL_ITERATORS_H
@@ -94,6 +94,7 @@ enum {
enum {
/* public */
REGIT_USE_KEY = 0x00000001,
+ REGIT_INVERTED = 0x00000002,
};
typedef enum {
diff --git a/ext/spl/tests/bug33136.phpt b/ext/spl/tests/bug33136.phpt
index 13b058307..2f3155f27 100755
--- a/ext/spl/tests/bug33136.phpt
+++ b/ext/spl/tests/bug33136.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #33136 method offsetSet in class extended from ArrayObject crash PHP
+Bug #33136 (method offsetSet in class extended from ArrayObject crash PHP)
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
diff --git a/ext/spl/tests/bug36287.phpt b/ext/spl/tests/bug36287.phpt
index 29ae0e2c9..03e695e2a 100755
--- a/ext/spl/tests/bug36287.phpt
+++ b/ext/spl/tests/bug36287.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #36287
+Bug #36287 (Segfault with SplFileInfo conversion)
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--