mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-24 09:25:41 +00:00
Compare commits
41
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7317b3d05b | ||
|
|
95fb5ed9f2 | ||
|
|
9e10c6551e | ||
|
|
c863f476a5 | ||
|
|
5fdf15ea49 | ||
|
|
7bc386b8dc | ||
|
|
32e2c573d5 | ||
|
|
8370d1a864 | ||
|
|
c99bdaf6de | ||
|
|
4eb9ceae9c | ||
|
|
dcf54a9b4d | ||
|
|
f407ad9511 | ||
|
|
d3e8ab4266 | ||
|
|
e246625a57 | ||
|
|
e92d4a936d | ||
|
|
97033293d1 | ||
|
|
08bdfef92a | ||
|
|
9d3069ca51 | ||
|
|
832fb5a6ea | ||
|
|
51db77f424 | ||
|
|
d71b9d508e | ||
|
|
22dcb6114f | ||
|
|
631f9905f2 | ||
|
|
4b0840e246 | ||
|
|
01149527a9 | ||
|
|
97518d37b3 | ||
|
|
802bc19f76 | ||
|
|
e0b76f3725 | ||
|
|
e04a7b8cc4 | ||
|
|
9a2a615af2 | ||
|
|
ec29c67a5a | ||
|
|
dcb44b5ed7 | ||
|
|
2cd05f8579 | ||
|
|
4b0ca8a569 | ||
|
|
9ce4941ec9 | ||
|
|
1b59a2cb3c | ||
|
|
31321a87ac | ||
|
|
eb6862369b | ||
|
|
1342ff0075 | ||
|
|
b0e2e6f752 | ||
|
|
bce3eee5be |
No files matched your search
@@ -1,13 +1,20 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
17 Jun 2010, PHP 5.2.14RC1
|
||||
- Upgraded bundled PCRE to version 8.02. (Ilia)
|
||||
|
||||
22 Jul 2010, PHP 5.2.14
|
||||
- Reverted bug fix #49521 (PDO fetchObject sets values before calling
|
||||
constructor). (Felipe)
|
||||
|
||||
- Updated timezone database to version 2010.5. (Derick)
|
||||
- Upgraded bundled PCRE to version 8.02. (Ilia)
|
||||
|
||||
- Rewrote var_export() to use smart_str rather than output buffering, prevents
|
||||
data disclosure if a fatal error occurs (CVE-2010-2531). (Scott)
|
||||
- Fixed a possible interruption array leak in strrchr(). Reported by
|
||||
Péter Veres. (CVE-2010-2484) (Felipe)
|
||||
- Fixed a possible interruption array leak in strchr(), strstr(), substr(),
|
||||
chunk_split(), strtok(), addcslashes(), str_repeat(), trim(). (Felipe)
|
||||
- Fixed a possible memory corruption in substr_replace() (Dmitry)
|
||||
- Fixed SplObjectStorage unserialization problems (CVE-2010-2225). (Stas)
|
||||
- Fixed a possible stack exaustion inside fnmatch(). Reporeted by Stefan
|
||||
Esser (Ilia)
|
||||
- Reset error state in PDO::beginTransaction() reset error state. (Ilia)
|
||||
@@ -21,9 +28,27 @@ PHP NEWS
|
||||
PDOStatement if instantiated directly instead of doing by the PDO methods.
|
||||
(Felipe)
|
||||
|
||||
- Fixed bug #52317 (Segmentation fault when using mail() on a rhel 4.x (only 64
|
||||
bit)). (Adam)
|
||||
- Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).
|
||||
(Johannes)
|
||||
- Fixed bug #52237 (Crash when passing the reference of the property of a
|
||||
non-object). (Dmitry)
|
||||
- Fixed bug #52163 (SplFileObject::fgetss() fails due to parameter that can't
|
||||
be set). (Felipe)
|
||||
- Fixed bug #52162 (custom request header variables with numbers are removed).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #52160 (Invalid E_STRICT redefined constructor error). (Felipe)
|
||||
- Fixed bug #52061 (memory_limit above 2G). (Felipe)
|
||||
- Fixed bug #52041 (Memory leak when writing on uninitialized variable returned
|
||||
from function). (Dmitry)
|
||||
- Fixed bug #52037 (Concurrent builds fail in install-programs). (seanius at
|
||||
debian dot org, Kalle)
|
||||
- Fixed bug #52019 (make lcov doesn't support TESTS variable anymore). (Patrick)
|
||||
- Fixed bug #52010 (open_basedir restrictions mismatch on vacuum command).
|
||||
(Ilia, Felipe)
|
||||
- Fixed bug #51943 (AIX: Several files are out of ANSI spec). (Kalle,
|
||||
coreystup at gmail dot com)
|
||||
- Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with
|
||||
constant array). (Felipe)
|
||||
- Fixed bug #51905 (ReflectionParameter fails if default value is an array
|
||||
@@ -76,7 +101,8 @@ PHP NEWS
|
||||
an invalid option is provided). (Ilia)
|
||||
- Fixed bug #51128 (imagefill() doesn't work with large images). (Pierre)
|
||||
- Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
|
||||
- Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris Jones)
|
||||
- Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris
|
||||
Jones)
|
||||
- Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4).
|
||||
(Raphael Geissert)
|
||||
- Fixed bug #50762 (in WSDL mode Soap Header handler function only being called
|
||||
@@ -85,6 +111,7 @@ PHP NEWS
|
||||
endpoints). (Justin Dearing)
|
||||
- Fixed bug #50383 (Exceptions thrown in __call() / __callStatic() do not
|
||||
include file and line in trace). (Felipe)
|
||||
- Fixed bug #49730 (Firebird - new PDO() returns NULL). (Felipe)
|
||||
- Fixed bug #49723 (LimitIterator with empty SeekableIterator). (Etienne)
|
||||
- Fixed bug #49576 (FILTER_VALIDATE_EMAIL filter needs updating) (Rasmus)
|
||||
- Fixed bug #49320 (PDO returns null when SQLite connection fails). (Felipe)
|
||||
@@ -93,6 +120,8 @@ PHP NEWS
|
||||
- Fixed bug #48289 (iconv_mime_encode() quoted-printable scheme is broken).
|
||||
(Adam, patch from hiroaki dot kawai at gmail dot com).
|
||||
- Fixed bug #43314 (iconv_mime_encode(), broken Q scheme). (Rasmus)
|
||||
- Fixed bug #33210 (getimagesize() fails to detect width/height on certain
|
||||
JPEGs). (Ilia)
|
||||
- Fixed bug #23229 (syslog() truncates messages). (Adam)
|
||||
|
||||
25 Feb 2010, PHP 5.2.13
|
||||
|
||||
@@ -30,7 +30,9 @@ if (defined("pass3")) {
|
||||
set_error_handler('errorHandler');
|
||||
define("pass2", 1);
|
||||
include(__FILE__);
|
||||
print "ok\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #52160 (Invalid E_STRICT redefined constructor error)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class bar {
|
||||
function __construct() { }
|
||||
static function bar() {
|
||||
var_dump(1);
|
||||
}
|
||||
}
|
||||
|
||||
bar::bar();
|
||||
|
||||
class foo {
|
||||
static function foo() {
|
||||
var_dump(2);
|
||||
}
|
||||
function __construct() { }
|
||||
}
|
||||
|
||||
foo::foo();
|
||||
|
||||
class baz {
|
||||
static function baz() {
|
||||
var_dump(3);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class foo in %s on line %d
|
||||
|
||||
Fatal error: Constructor baz::baz() cannot be static in %s on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #52237 (Crash when passing the reference of the property of a non-object)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = 'test';
|
||||
preg_match('//', '', $data->info);
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "test"
|
||||
@@ -14,6 +14,5 @@ class test {
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class test in %s on line %d
|
||||
--EXPECT--
|
||||
Done
|
||||
+1
-1
@@ -1090,7 +1090,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
|
||||
mm_heap->large_free_buckets[i]->parent = &mm_heap->large_free_buckets[i];
|
||||
}
|
||||
}
|
||||
mm_heap->rest_buckets[0]->next_free_block = mm_heap->rest_buckets[1]->prev_free_block = ZEND_MM_REST_BUCKET(mm_heap);
|
||||
mm_heap->rest_buckets[0] = mm_heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(mm_heap);
|
||||
|
||||
free(heap);
|
||||
heap = mm_heap;
|
||||
|
||||
+6
-5
@@ -1175,9 +1175,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
/* Improve after RC: cache the lowercase class name */
|
||||
|
||||
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
} else {
|
||||
if (!CG(active_class_entry)->constructor) {
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
}
|
||||
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
|
||||
@@ -2011,13 +2009,16 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
/* If it's a user function then arg_info == NULL means we don't have any parameters but we still need to do the arg number checks. We are only willing to ignore this for internal functions because extensions don't always define arg_info. */
|
||||
/* If it's a user function then arg_info == NULL means we don't have any parameters but
|
||||
* we still need to do the arg number checks. We are only willing to ignore this for internal
|
||||
* functions because extensions don't always define arg_info.
|
||||
*/
|
||||
if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Checks for constructors only if they are declared in an interface */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_CTOR) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
if ((fe->common.fn_flags & ZEND_ACC_CTOR) && (proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,33 @@ ZEND_API int zend_atoi(const char *str, int str_len)
|
||||
return retval;
|
||||
}
|
||||
|
||||
ZEND_API long zend_atol(const char *str, int str_len) /* {{{ */
|
||||
{
|
||||
long retval;
|
||||
|
||||
if (!str_len) {
|
||||
str_len = strlen(str);
|
||||
}
|
||||
retval = strtol(str, NULL, 0);
|
||||
if (str_len>0) {
|
||||
switch (str[str_len-1]) {
|
||||
case 'g':
|
||||
case 'G':
|
||||
retval *= 1024;
|
||||
/* break intentionally missing */
|
||||
case 'm':
|
||||
case 'M':
|
||||
retval *= 1024;
|
||||
/* break intentionally missing */
|
||||
case 'k':
|
||||
case 'K':
|
||||
retval *= 1024;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length)
|
||||
{
|
||||
|
||||
@@ -303,6 +303,7 @@ ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC);
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
|
||||
|
||||
ZEND_API int zend_atoi(const char *str, int str_len);
|
||||
ZEND_API long zend_atol(const char *str, int str_len);
|
||||
|
||||
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
|
||||
END_EXTERN_C()
|
||||
|
||||
+10
-3
@@ -2378,9 +2378,16 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
(*varptr_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
(*varptr_ptr)->refcount = 0;
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
|
||||
+20
-6
@@ -7605,9 +7605,16 @@ static int ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
if (IS_VAR == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
(*varptr_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
(*varptr_ptr)->refcount = 0;
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
@@ -20041,9 +20048,16 @@ static int ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
if (IS_CV == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
(*varptr_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
(*varptr_ptr)->refcount = 0;
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@
|
||||
|
||||
#define TIMELIB_ERROR 999
|
||||
|
||||
/* Some compilers like AIX, defines uchar in sys/types.h */
|
||||
#undef uchar
|
||||
typedef unsigned char uchar;
|
||||
|
||||
#define BSIZE 8192
|
||||
|
||||
@@ -86,6 +86,8 @@
|
||||
|
||||
#define TIMELIB_ERROR 999
|
||||
|
||||
/* Some compilers like AIX, defines uchar in sys/types.h */
|
||||
#undef uchar
|
||||
typedef unsigned char uchar;
|
||||
|
||||
#define BSIZE 8192
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
typedef struct {
|
||||
php_hash_uint64 state[3];
|
||||
php_hash_uint64 passed;
|
||||
unsigned char passes:1;
|
||||
unsigned char length:7;
|
||||
unsigned int passes:1;
|
||||
unsigned int length:7;
|
||||
unsigned char buffer[64];
|
||||
} PHP_TIGER_CTX;
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ enum pdo_case_conversion {
|
||||
enum pdo_null_handling {
|
||||
PDO_NULL_NATURAL = 0,
|
||||
PDO_NULL_EMPTY_STRING = 1,
|
||||
PDO_NULL_TO_STRING = 2,
|
||||
PDO_NULL_TO_STRING = 2
|
||||
};
|
||||
|
||||
/* {{{ utils for reading attributes set as driver_options */
|
||||
@@ -343,7 +343,7 @@ enum pdo_param_event {
|
||||
PDO_PARAM_EVT_EXEC_POST,
|
||||
PDO_PARAM_EVT_FETCH_PRE,
|
||||
PDO_PARAM_EVT_FETCH_POST,
|
||||
PDO_PARAM_EVT_NORMALIZE,
|
||||
PDO_PARAM_EVT_NORMALIZE
|
||||
};
|
||||
|
||||
typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC);
|
||||
|
||||
@@ -648,6 +648,14 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM
|
||||
efree(vars[i].optval);
|
||||
}
|
||||
}
|
||||
|
||||
if (!dbh->methods) {
|
||||
char errmsg[512];
|
||||
ISC_STATUS *s = H->isc_status;
|
||||
isc_interprete(errmsg, &s);
|
||||
zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1] TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
|
||||
"HY000", H->isc_status[1], errmsg);
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
firebird_handle_closer(dbh TSRMLS_CC);
|
||||
|
||||
@@ -642,7 +642,7 @@ static struct pdo_dbh_methods sqlite_methods = {
|
||||
|
||||
static char *make_filename_safe(const char *filename TSRMLS_DC)
|
||||
{
|
||||
if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
|
||||
if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
|
||||
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
|
||||
|
||||
if (!fullpath) {
|
||||
|
||||
@@ -64,10 +64,7 @@ foreach ($classes as $class) {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line 26
|
||||
|
||||
Strict Standards: %s for class NewAndOldCtor in %s on line 31
|
||||
Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line %d
|
||||
Constructor of NewCtor: __construct
|
||||
Constructor of ExtendsNewCtor: __construct
|
||||
Constructor of OldCtor: OldCtor
|
||||
@@ -79,4 +76,4 @@ Constructor of C: C
|
||||
Constructor of D1: __construct
|
||||
Constructor of D2: C
|
||||
No constructor for X
|
||||
No constructor for Y
|
||||
No constructor for Y
|
||||
@@ -88,8 +88,6 @@ var_dump($methodInfo->isConstructor());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line %d
|
||||
|
||||
Strict Standards: %s for class NewAndOldCtor in %s on line %d
|
||||
New-style constructor:
|
||||
bool(true)
|
||||
|
||||
|
||||
@@ -64,10 +64,7 @@ foreach ($classes as $class) {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line 26
|
||||
|
||||
Strict Standards: %s for class NewAndOldCtor in %s on line 31
|
||||
Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line %d
|
||||
Constructor of NewCtor: __construct
|
||||
Constructor of ExtendsNewCtor: __construct
|
||||
Constructor of OldCtor: OldCtor
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
SPL: Test that serialized blob contains unique elements (CVE-2010-2225)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$badblobs = array(
|
||||
'x:i:2;i:0;;i:0;;m:a:0:{}',
|
||||
'x:i:2;O:8:"stdClass":0:{};R:1;;m:a:0:{}',
|
||||
'x:i:3;O:8:"stdClass":0:{};r:1;;r:1;;m:a:0:{}',
|
||||
);
|
||||
foreach($badblobs as $blob) {
|
||||
try {
|
||||
$so = new SplObjectStorage();
|
||||
$so->unserialize($blob);
|
||||
var_dump($so);
|
||||
} catch(UnexpectedValueException $e) {
|
||||
echo $e->getMessage()."\n";
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Error at offset 6 of 24 bytes
|
||||
Error at offset 26 of 39 bytes
|
||||
object(SplObjectStorage)#2 (0) {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
SPL: Test unserializing tested & linked storage
|
||||
--FILE--
|
||||
<?php
|
||||
$o = new StdClass();
|
||||
$a = new StdClass();
|
||||
|
||||
$o->a = $a;
|
||||
|
||||
$so = new SplObjectStorage();
|
||||
|
||||
$so->attach($o);
|
||||
$so->attach($a);
|
||||
|
||||
$s = serialize($so);
|
||||
echo $s."\n";
|
||||
|
||||
$so1 = unserialize($s);
|
||||
var_dump($so1);
|
||||
foreach($so1 as $obj) {
|
||||
var_dump($obj);
|
||||
}
|
||||
--EXPECTF--
|
||||
C:16:"SplObjectStorage":66:{x:i:2;O:8:"stdClass":1:{s:1:"a";O:8:"stdClass":0:{}};r:2;;m:a:0:{}}
|
||||
object(SplObjectStorage)#4 (0) {
|
||||
}
|
||||
object(stdClass)#5 (1) {
|
||||
["a"]=>
|
||||
object(stdClass)#6 (0) {
|
||||
}
|
||||
}
|
||||
object(stdClass)#6 (0) {
|
||||
}
|
||||
@@ -2118,7 +2118,12 @@ SPL_METHOD(SplFileObject, fgetss)
|
||||
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
|
||||
zval *arg2 = NULL;
|
||||
MAKE_STD_ZVAL(arg2);
|
||||
ZVAL_LONG(arg2, intern->u.file.max_line_len);
|
||||
|
||||
if (intern->u.file.max_line_len > 0) {
|
||||
ZVAL_LONG(arg2, intern->u.file.max_line_len);
|
||||
} else {
|
||||
ZVAL_LONG(arg2, 1024);
|
||||
}
|
||||
|
||||
spl_filesystem_file_free_line(intern TSRMLS_CC);
|
||||
intern->u.file.current_line_num++;
|
||||
|
||||
@@ -2701,7 +2701,9 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
|
||||
}
|
||||
|
||||
done:
|
||||
iter->funcs->dtor(iter TSRMLS_CC);
|
||||
if (iter) {
|
||||
iter->funcs->dtor(iter TSRMLS_CC);
|
||||
}
|
||||
return EG(exception) ? FAILURE : SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+27
-11
@@ -182,6 +182,21 @@ SPL_METHOD(SplObjectStorage, detach)
|
||||
intern->index = 0;
|
||||
} /* }}} */
|
||||
|
||||
int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *obj TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#if HAVE_PACKED_OBJECT_VALUE
|
||||
return zend_hash_exists(&intern->storage, (char*)&Z_OBJVAL_P(obj), sizeof(zend_object_value));
|
||||
#else
|
||||
{
|
||||
zend_object_value zvalue;
|
||||
memset(&zvalue, 0, sizeof(zend_object_value));
|
||||
zvalue.handle = Z_OBJ_HANDLE_P(obj);
|
||||
zvalue.handlers = Z_OBJ_HT_P(obj);
|
||||
return zend_hash_exists(&intern->storage, (char*)&zvalue, sizeof(zend_object_value));
|
||||
}
|
||||
#endif
|
||||
} /* }}} */
|
||||
|
||||
/* {{{ proto bool SplObjectStorage::contains($obj)
|
||||
Determine whethe an object is contained in the storage */
|
||||
SPL_METHOD(SplObjectStorage, contains)
|
||||
@@ -193,17 +208,7 @@ SPL_METHOD(SplObjectStorage, contains)
|
||||
return;
|
||||
}
|
||||
|
||||
#if HAVE_PACKED_OBJECT_VALUE
|
||||
RETURN_BOOL(zend_hash_exists(&intern->storage, (char*)&Z_OBJVAL_P(obj), sizeof(zend_object_value)));
|
||||
#else
|
||||
{
|
||||
zend_object_value zvalue;
|
||||
memset(&zvalue, 0, sizeof(zend_object_value));
|
||||
zvalue.handle = Z_OBJ_HANDLE_P(obj);
|
||||
zvalue.handlers = Z_OBJ_HT_P(obj);
|
||||
RETURN_BOOL(zend_hash_exists(&intern->storage, (char*)&zvalue, sizeof(zend_object_value)));
|
||||
}
|
||||
#endif
|
||||
RETURN_BOOL(spl_object_storage_contains(intern, obj TSRMLS_CC));
|
||||
} /* }}} */
|
||||
|
||||
/* {{{ proto int SplObjectStorage::count()
|
||||
@@ -362,11 +367,22 @@ SPL_METHOD(SplObjectStorage, unserialize)
|
||||
goto outexcept;
|
||||
}
|
||||
++p;
|
||||
if(*p != 'O' && *p != 'C' && *p != 'r') {
|
||||
goto outexcept;
|
||||
}
|
||||
ALLOC_INIT_ZVAL(pentry);
|
||||
if (!php_var_unserialize(&pentry, &p, s + buf_len, &var_hash TSRMLS_CC)) {
|
||||
zval_ptr_dtor(&pentry);
|
||||
goto outexcept;
|
||||
}
|
||||
if(Z_TYPE_P(pentry) != IS_OBJECT) {
|
||||
zval_ptr_dtor(&pentry);
|
||||
goto outexcept;
|
||||
}
|
||||
if(spl_object_storage_contains(intern, pentry TSRMLS_CC)) {
|
||||
zval_ptr_dtor(&pentry);
|
||||
continue;
|
||||
}
|
||||
spl_object_storage_attach(intern, pentry TSRMLS_CC);
|
||||
zval_ptr_dtor(&pentry);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #52238 - Crash when an Exception occured in iterator_to_array
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo implements IteratorAggregate
|
||||
{
|
||||
public function bar() {
|
||||
throw new Exception;
|
||||
}
|
||||
|
||||
public function getIterator() {
|
||||
return new ArrayIterator($this->bar());
|
||||
}
|
||||
}
|
||||
var_dump(iterator_to_array(new Foo));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %s
|
||||
Stack trace:
|
||||
#0 %s: Foo->bar()
|
||||
#1 [internal function]: Foo->getIterator()
|
||||
#2 %s: iterator_to_array(Object(Foo))
|
||||
#3 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -515,7 +515,7 @@ static struct pdo_dbh_methods sqlite2_methods = {
|
||||
|
||||
static char *make_filename_safe(const char *filename TSRMLS_DC)
|
||||
{
|
||||
if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
|
||||
if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
|
||||
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
|
||||
|
||||
if (!fullpath) {
|
||||
|
||||
@@ -6231,7 +6231,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, int callback_type,
|
||||
}
|
||||
|
||||
if (!(Z_STRLEN_P(arg1) > 1 && Z_STRVAL_P(arg1)[0] == '0') && is_numeric_string(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), NULL, NULL, 0) == IS_LONG) {
|
||||
ulong key = (ulong) zend_atoi(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
|
||||
ulong key = (ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
|
||||
if (zend_hash_index_find(Z_ARRVAL_P(arr), key, (void **) &find_hash) == FAILURE) {
|
||||
ALLOC_ZVAL(hash);
|
||||
INIT_PZVAL(hash);
|
||||
|
||||
@@ -398,12 +398,7 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co
|
||||
last_marker = M_PSEUDO; /* stop skipping non 0xff for M_COM */
|
||||
}
|
||||
}
|
||||
if (++a > 25)
|
||||
{
|
||||
/* who knows the maxim amount of 0xff? though 7 */
|
||||
/* but found other implementations */
|
||||
return M_EOI;
|
||||
}
|
||||
a++;
|
||||
} while (marker == 0xff);
|
||||
if (a < 2)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
#include "php_mail.h"
|
||||
#include "php_ini.h"
|
||||
#include "php_string.h"
|
||||
#include "safe_mode.h"
|
||||
#include "exec.h"
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ PHP_FUNCTION(memory_get_peak_usage);
|
||||
|
||||
PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC);
|
||||
PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC);
|
||||
PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC);
|
||||
|
||||
PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC);
|
||||
|
||||
/* typdef HashTable php_serialize_data_t; */
|
||||
|
||||
@@ -774,6 +774,9 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(*str)) {
|
||||
SEPARATE_ZVAL(str);
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
|
||||
if (argc > 1) {
|
||||
@@ -1230,6 +1233,9 @@ PHP_FUNCTION(strtok)
|
||||
case 2:
|
||||
str = args[0];
|
||||
tok = args[1];
|
||||
if (PZVAL_IS_REF(*str)) {
|
||||
SEPARATE_ZVAL(str);
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
|
||||
zval_add_ref(str);
|
||||
@@ -1766,6 +1772,9 @@ PHP_FUNCTION(strstr)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(*haystack)) {
|
||||
SEPARATE_ZVAL(haystack);
|
||||
}
|
||||
convert_to_string_ex(haystack);
|
||||
|
||||
if (Z_TYPE_PP(needle) == IS_STRING) {
|
||||
@@ -2116,6 +2125,9 @@ PHP_FUNCTION(strrchr)
|
||||
FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (PZVAL_IS_REF(*haystack)) {
|
||||
SEPARATE_ZVAL(haystack);
|
||||
}
|
||||
convert_to_string_ex(haystack);
|
||||
|
||||
if (Z_TYPE_PP(needle) == IS_STRING) {
|
||||
@@ -2202,6 +2214,9 @@ PHP_FUNCTION(chunk_split)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(*p_str)) {
|
||||
SEPARATE_ZVAL(p_str);
|
||||
}
|
||||
convert_to_string_ex(p_str);
|
||||
|
||||
if (argc > 1) {
|
||||
@@ -2257,6 +2272,9 @@ PHP_FUNCTION(substr)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(*str)) {
|
||||
SEPARATE_ZVAL(str);
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
convert_to_long_ex(from);
|
||||
|
||||
@@ -2338,12 +2356,21 @@ PHP_FUNCTION(substr_replace)
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(str) != IS_ARRAY) {
|
||||
if (PZVAL_IS_REF(*str)) {
|
||||
SEPARATE_ZVAL(str);
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
}
|
||||
if (Z_TYPE_PP(repl) != IS_ARRAY) {
|
||||
if (PZVAL_IS_REF(*repl)) {
|
||||
SEPARATE_ZVAL(repl);
|
||||
}
|
||||
convert_to_string_ex(repl);
|
||||
}
|
||||
if (Z_TYPE_PP(from) != IS_ARRAY) {
|
||||
if (PZVAL_IS_REF(*from)) {
|
||||
SEPARATE_ZVAL(from);
|
||||
}
|
||||
convert_to_long_ex(from);
|
||||
}
|
||||
|
||||
@@ -3044,6 +3071,9 @@ PHP_FUNCTION(addcslashes)
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &str, &what) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (PZVAL_IS_REF(*str)) {
|
||||
SEPARATE_ZVAL(str);
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
convert_to_string_ex(what);
|
||||
|
||||
@@ -4617,6 +4647,9 @@ PHP_FUNCTION(str_repeat)
|
||||
}
|
||||
|
||||
/* Make sure we're dealing with proper types */
|
||||
if (PZVAL_IS_REF(*input_str)) {
|
||||
SEPARATE_ZVAL(input_str);
|
||||
}
|
||||
convert_to_string_ex(input_str);
|
||||
convert_to_long_ex(mult);
|
||||
|
||||
|
||||
@@ -14,12 +14,5 @@ var_export($obj, true);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
stdClass::__set_state(array(
|
||||
'p' =>
|
||||
stdClass::__set_state(array(
|
||||
'p' =>
|
||||
stdClass::__set_state(array(
|
||||
'p' =>
|
||||
stdClass::__set_state(array(
|
||||
|
||||
Fatal error: Nesting level too deep - recursive dependency? in %s on line 9
|
||||
@@ -14,14 +14,5 @@ var_export($a, true);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
|
||||
Fatal error: Nesting level too deep - recursive dependency? in %s on line 9
|
||||
+94
-40
@@ -346,54 +346,83 @@ PHP_FUNCTION(debug_zval_dump)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#define buffer_append_spaces(buf, num_spaces) \
|
||||
do { \
|
||||
char *tmp_spaces; \
|
||||
int tmp_spaces_len; \
|
||||
tmp_spaces_len = spprintf(&tmp_spaces, 0,"%*c", num_spaces, ' '); \
|
||||
smart_str_appendl(buf, tmp_spaces, tmp_spaces_len); \
|
||||
efree(tmp_spaces); \
|
||||
} while(0);
|
||||
/* {{{ php_var_export */
|
||||
|
||||
static int php_array_element_export(zval **zv, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
int level;
|
||||
smart_str *buf;
|
||||
|
||||
TSRMLS_FETCH();
|
||||
|
||||
level = va_arg(args, int);
|
||||
buf = va_arg(args, smart_str *);
|
||||
|
||||
if (hash_key->nKeyLength==0) { /* numeric key */
|
||||
php_printf("%*c%ld => ", level + 1, ' ', hash_key->h);
|
||||
if (hash_key->nKeyLength == 0) { /* numeric key */
|
||||
buffer_append_spaces(buf, level+1);
|
||||
smart_str_append_long(buf, hash_key->h);
|
||||
smart_str_appendl(buf, " => ", 4);
|
||||
} else { /* string key */
|
||||
char *key, *tmp_str;
|
||||
int key_len, tmp_len;
|
||||
key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC);
|
||||
tmp_str = php_str_to_str_ex(key, key_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len, 0, NULL);
|
||||
php_printf("%*c'", level + 1, ' ');
|
||||
PHPWRITE(tmp_str, tmp_len);
|
||||
php_printf("' => ");
|
||||
|
||||
buffer_append_spaces(buf, level + 1);
|
||||
|
||||
smart_str_appendc(buf, '\'');
|
||||
smart_str_appendl(buf, tmp_str, tmp_len);
|
||||
smart_str_appendl(buf, "' => ", 5);
|
||||
|
||||
efree(key);
|
||||
efree(tmp_str);
|
||||
}
|
||||
php_var_export(zv, level + 2 TSRMLS_CC);
|
||||
PUTS (",\n");
|
||||
php_var_export_ex(zv, level + 2, buf TSRMLS_CC);
|
||||
|
||||
smart_str_appendc(buf, ',');
|
||||
smart_str_appendc(buf, '\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int php_object_element_export(zval **zv, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
int level;
|
||||
smart_str *buf;
|
||||
char *prop_name, *class_name;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
level = va_arg(args, int);
|
||||
buf = va_arg(args, smart_str *);
|
||||
|
||||
php_printf("%*c", level + 1, ' ');
|
||||
buffer_append_spaces(buf, level + 2);
|
||||
if (hash_key->nKeyLength != 0) {
|
||||
zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength - 1, &class_name, &prop_name);
|
||||
php_printf(" '%s' => ", prop_name);
|
||||
|
||||
smart_str_appendc(buf, '\'');
|
||||
smart_str_appends(buf, prop_name);
|
||||
smart_str_appendc(buf, '\'');
|
||||
} else {
|
||||
php_printf(" %ld => ", hash_key->h);
|
||||
smart_str_append_long(buf, hash_key->h);
|
||||
}
|
||||
php_var_export(zv, level + 2 TSRMLS_CC);
|
||||
PUTS (",\n");
|
||||
|
||||
smart_str_appendl(buf, " => ", 4);
|
||||
php_var_export_ex(zv, level + 2, buf TSRMLS_CC);
|
||||
smart_str_appendc(buf, ',');
|
||||
smart_str_appendc(buf, '\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC)
|
||||
PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
HashTable *myht;
|
||||
char *tmp_str, *tmp_str2;
|
||||
@@ -403,60 +432,85 @@ PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC)
|
||||
|
||||
switch (Z_TYPE_PP(struc)) {
|
||||
case IS_BOOL:
|
||||
php_printf("%s", Z_LVAL_PP(struc) ? "true" : "false");
|
||||
if (Z_LVAL_PP(struc)) {
|
||||
smart_str_appendl(buf, "true", 4);
|
||||
} else {
|
||||
smart_str_appendl(buf, "false", 5);
|
||||
}
|
||||
break;
|
||||
case IS_NULL:
|
||||
php_printf("NULL");
|
||||
smart_str_appendl(buf, "NULL", 4);
|
||||
break;
|
||||
case IS_LONG:
|
||||
php_printf("%ld", Z_LVAL_PP(struc));
|
||||
smart_str_append_long(buf, Z_LVAL_PP(struc));
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
php_printf("%.*H", (int) EG(precision), Z_DVAL_PP(struc));
|
||||
tmp_len = spprintf(&tmp_str, 0,"%.*H", (int) EG(precision), Z_DVAL_PP(struc));
|
||||
smart_str_appendl(buf, tmp_str, tmp_len);
|
||||
efree(tmp_str);
|
||||
break;
|
||||
case IS_STRING:
|
||||
tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\", 2 TSRMLS_CC);
|
||||
tmp_str2 = php_str_to_str_ex(tmp_str, tmp_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len2, 0, NULL);
|
||||
PUTS ("'");
|
||||
PHPWRITE(tmp_str2, tmp_len2);
|
||||
PUTS ("'");
|
||||
|
||||
smart_str_appendc(buf, '\'');
|
||||
smart_str_appendl(buf, tmp_str2, tmp_len2);
|
||||
smart_str_appendc(buf, '\'');
|
||||
|
||||
efree(tmp_str2);
|
||||
efree(tmp_str);
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
myht = Z_ARRVAL_PP(struc);
|
||||
if (level > 1) {
|
||||
php_printf("\n%*c", level - 1, ' ');
|
||||
smart_str_appendc(buf, '\n');
|
||||
buffer_append_spaces(buf, level - 1);
|
||||
}
|
||||
PUTS ("array (\n");
|
||||
zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_array_element_export, 1, level, 0);
|
||||
smart_str_appendl(buf, "array (\n", 8);
|
||||
zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_array_element_export, 2, level, buf);
|
||||
|
||||
if (level > 1) {
|
||||
php_printf("%*c", level - 1, ' ');
|
||||
buffer_append_spaces(buf, level - 1);
|
||||
}
|
||||
PUTS(")");
|
||||
smart_str_appendc(buf, ')');
|
||||
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
myht = Z_OBJPROP_PP(struc);
|
||||
if (level > 1) {
|
||||
php_printf("\n%*c", level - 1, ' ');
|
||||
smart_str_appendc(buf, '\n');
|
||||
buffer_append_spaces(buf, level - 1);
|
||||
}
|
||||
Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
|
||||
php_printf ("%s::__set_state(array(\n", class_name);
|
||||
|
||||
smart_str_appendl(buf, class_name, class_name_len);
|
||||
smart_str_appendl(buf, "::__set_state(array(\n", 21);
|
||||
|
||||
efree(class_name);
|
||||
if (myht) {
|
||||
zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_object_element_export, 1, level);
|
||||
zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_object_element_export, 2, level, buf);
|
||||
}
|
||||
if (level > 1) {
|
||||
php_printf("%*c", level - 1, ' ');
|
||||
buffer_append_spaces(buf, level - 1);
|
||||
}
|
||||
php_printf ("))");
|
||||
smart_str_appendl(buf, "))", 2);
|
||||
|
||||
break;
|
||||
default:
|
||||
PUTS ("NULL");
|
||||
smart_str_appendl(buf, "NULL", 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* FOR BC reasons, this will always perform and then print */
|
||||
PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
smart_str buf = {0};
|
||||
php_var_export_ex(struc, level, &buf TSRMLS_CC);
|
||||
smart_str_0 (&buf);
|
||||
PHPWRITE(buf.c, buf.len);
|
||||
smart_str_free(&buf);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed var_export(mixed var [, bool return])
|
||||
@@ -465,21 +519,21 @@ PHP_FUNCTION(var_export)
|
||||
{
|
||||
zval *var;
|
||||
zend_bool return_output = 0;
|
||||
|
||||
smart_str buf = {0};
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (return_output) {
|
||||
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
php_var_export(&var, 1 TSRMLS_CC);
|
||||
|
||||
php_var_export_ex(&var, 1, &buf TSRMLS_CC);
|
||||
smart_str_0 (&buf);
|
||||
|
||||
if (return_output) {
|
||||
php_ob_get_buffer (return_value TSRMLS_CC);
|
||||
php_end_ob_buffer (0, 0 TSRMLS_CC);
|
||||
RETVAL_STRINGL(buf.c, buf.len, 1);
|
||||
} else {
|
||||
PHPWRITE(buf.c, buf.len);
|
||||
}
|
||||
smart_str_free(&buf);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+43
-2
@@ -8,7 +8,7 @@ PHP_ARG_WITH(sybase-ct, for Sybase-CT support,
|
||||
|
||||
if test "$PHP_SYBASE_CT" != "no"; then
|
||||
|
||||
if test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then
|
||||
if test "$PHP_SYBASE" && test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then
|
||||
AC_MSG_ERROR([You can not use both --with-sybase and --with-sybase-ct in same build!])
|
||||
fi
|
||||
|
||||
@@ -31,9 +31,50 @@ if test "$PHP_SYBASE_CT" != "no"; then
|
||||
fi
|
||||
|
||||
PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD)
|
||||
if test -f $SYBASE_CT_INCDIR/tds.h; then
|
||||
if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then
|
||||
PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD)
|
||||
SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lct"
|
||||
elif test -f $SYBASE_CT_INCDIR/libsybct64; then
|
||||
PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(sybintl64,, SYBASE_CT_SHARED_LIBADD)
|
||||
|
||||
ac_solid_uname_s=`uname -s 2>/dev/null`
|
||||
case $ac_solid_uname_s in
|
||||
*OSF*) ;; # Tru64/DEC OSF does NOT use the SYB_LP64 define
|
||||
*) CFLAGS="${CFLAGS} -DSYB_LP64" ;; #
|
||||
esac
|
||||
SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64"
|
||||
|
||||
PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [
|
||||
PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD)
|
||||
],[
|
||||
PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD)
|
||||
],[
|
||||
$SYBASE_CT_LIBS
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR])
|
||||
PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR])
|
||||
elif test -f $SYBASE_CT_INCDIR/libsybct; then
|
||||
PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD)
|
||||
|
||||
SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl"
|
||||
|
||||
PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [
|
||||
PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD)
|
||||
],[
|
||||
PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD)
|
||||
],[
|
||||
$SYBASE_CT_LIBS
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR])
|
||||
PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR])
|
||||
else
|
||||
PHP_ADD_LIBRARY(cs,, SYBASE_CT_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD)
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ static PHP_INI_MH(OnSetPrecision)
|
||||
static PHP_INI_MH(OnChangeMemoryLimit)
|
||||
{
|
||||
if (new_value) {
|
||||
PG(memory_limit) = zend_atoi(new_value, new_value_length);
|
||||
PG(memory_limit) = zend_atol(new_value, new_value_length);
|
||||
} else {
|
||||
PG(memory_limit) = 1<<30; /* effectively, no limit */
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,5 +4,5 @@
|
||||
#define PHP_MINOR_VERSION 2
|
||||
#define PHP_RELEASE_VERSION 14
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.2.14RC1"
|
||||
#define PHP_VERSION "5.2.14"
|
||||
#define PHP_VERSION_ID 50214
|
||||
+1
-1
@@ -634,7 +634,7 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
|
||||
if (value) {
|
||||
for(p = value + pos; *p; p++) {
|
||||
*p = toupper(*p);
|
||||
if (*p < 'A' || *p > 'Z') {
|
||||
if (!isalnum(*p)) {
|
||||
*p = '_';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ install-build:
|
||||
|
||||
install-programs: $(builddir)/phpize $(builddir)/php-config
|
||||
@echo "Installing helper programs: $(INSTALL_ROOT)$(bindir)/"
|
||||
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
|
||||
@for prog in $(bin_SCRIPTS); do \
|
||||
echo " program: $(program_prefix)$${prog}$(program_suffix)"; \
|
||||
$(INSTALL) -m 755 $(builddir)/$${prog} $(INSTALL_ROOT)$(bindir)/$(program_prefix)$${prog}$(program_suffix); \
|
||||
|
||||
Reference in new issue
Block a user