diff options
author | Christopher Jones <sixd@php.net> | 2012-10-08 16:13:07 -0700 |
---|---|---|
committer | Christopher Jones <sixd@php.net> | 2012-10-08 16:13:07 -0700 |
commit | 91169fb24fa2c63d6cbab226a02d5fef277ea11b (patch) | |
tree | 8d088abd1cfaf881697f87b59e230ddbf3863b7f /ext/standard | |
parent | f0c65bc0e3bb4565101a9dadb8fb01ef2a760d49 (diff) | |
parent | 67611c67fa5a3b2c199d41ef7df3307308c56faa (diff) | |
download | php-git-91169fb24fa2c63d6cbab226a02d5fef277ea11b.tar.gz |
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4
* 'PHP-5.4' of https://git.php.net/repository/php-src: (45 commits)
Fixed bug #63219 (Segfault when aliasing trait method when autoloader throws excpetion)
exposing the libxpm version in phpinfo
5.4.9-dev
PHP-5.3 branch is 5.3.19 now
reverted the previous fix for libpng include
fixed include checks for libpng under win
Avoding superfluous function call
Add test for #35895
Now we can set the tsrm_ls manually
Fixed bug #63184 test (ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt failed)
add news for --offline
add --offline option to run-tests command
Bug #63147: SKIP_ONLINE_TESTS, for getmxrr
Bug #63147: introduce SKIP_ONLINE_TESTS, for gethostbyname
gethostbyname_basic002.phpt is a duplicate to gethostbyname_error004.phpt
add bug #63162
fix test and move to proper place
synergy ftl. Removed duplicate fields.
adding test phpt
Bug #63162 - parse_url does not matches password component
...
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/tests/network/gethostbyname_basic001.phpt | 1 | ||||
-rw-r--r-- | ext/standard/tests/network/gethostbyname_basic002.phpt | 15 | ||||
-rw-r--r-- | ext/standard/tests/network/gethostbyname_error004.phpt | 1 | ||||
-rw-r--r-- | ext/standard/tests/network/getmxrr.phpt | 1 | ||||
-rw-r--r-- | ext/standard/tests/serialize/bug35895.phpt | 24 | ||||
-rw-r--r-- | ext/standard/tests/url/bug63162.phpt | 38 | ||||
-rw-r--r-- | ext/standard/url.c | 2 | ||||
-rw-r--r-- | ext/standard/var.c | 8 |
8 files changed, 72 insertions, 18 deletions
diff --git a/ext/standard/tests/network/gethostbyname_basic001.phpt b/ext/standard/tests/network/gethostbyname_basic001.phpt index e917b59920..9171e226aa 100644 --- a/ext/standard/tests/network/gethostbyname_basic001.phpt +++ b/ext/standard/tests/network/gethostbyname_basic001.phpt @@ -5,6 +5,7 @@ gethostbyname() function - basic type return test --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); ?> --FILE-- <?php diff --git a/ext/standard/tests/network/gethostbyname_basic002.phpt b/ext/standard/tests/network/gethostbyname_basic002.phpt deleted file mode 100644 index 983faa929e..0000000000 --- a/ext/standard/tests/network/gethostbyname_basic002.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -gethostbyname() function - basic invalid parameter test ---CREDITS-- -"Sylvain R." <sracine@phpquebec.org> ---SKIPIF-- -<?php -if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -?> ---FILE-- -<?php - $ip = gethostbyname("www.php.net"); - var_dump((bool) ip2long($ip)); -?> ---EXPECT-- -bool(true) diff --git a/ext/standard/tests/network/gethostbyname_error004.phpt b/ext/standard/tests/network/gethostbyname_error004.phpt index 7aac172920..274301a236 100644 --- a/ext/standard/tests/network/gethostbyname_error004.phpt +++ b/ext/standard/tests/network/gethostbyname_error004.phpt @@ -5,6 +5,7 @@ gethostbyname() function - basic return valid ip address test --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); ?> --FILE-- <?php diff --git a/ext/standard/tests/network/getmxrr.phpt b/ext/standard/tests/network/getmxrr.phpt index 29cea1d71e..c4a15c52ce 100644 --- a/ext/standard/tests/network/getmxrr.phpt +++ b/ext/standard/tests/network/getmxrr.phpt @@ -3,6 +3,7 @@ getmxrr() test --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip: no Windows support'); } diff --git a/ext/standard/tests/serialize/bug35895.phpt b/ext/standard/tests/serialize/bug35895.phpt new file mode 100644 index 0000000000..22fce0d1f2 --- /dev/null +++ b/ext/standard/tests/serialize/bug35895.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #35895 (__sleep and private property) +--FILE-- +<?php +class Parents { + private $parents; + public function __sleep() { + return array("parents"); + } +} + +class Child extends Parents { + private $child; + public function __sleep() { + return array_merge(array("child"), parent::__sleep()); + } +} + +$obj = new Child(); +serialize($obj); + +?> +--EXPECTF-- +Notice: serialize(): "parents" returned as member variable from __sleep() but does not exist in %sbug35895.php on line %d diff --git a/ext/standard/tests/url/bug63162.phpt b/ext/standard/tests/url/bug63162.phpt new file mode 100644 index 0000000000..ea5205efd6 --- /dev/null +++ b/ext/standard/tests/url/bug63162.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test parse_url() for bug #63162 +--DESCRIPTION-- +This test covers tests the inputs: +[0]=> http://user:pass@host +[1]=> //user:pass@host +[2]=> //user@host +--FILE-- +<?php +var_dump(parse_url('http://user:pass@host')); +var_dump(parse_url('//user:pass@host')); +var_dump(parse_url('//user@host')); +?> +--EXPECT-- +array(4) { + ["scheme"]=> + string(4) "http" + ["host"]=> + string(4) "host" + ["user"]=> + string(4) "user" + ["pass"]=> + string(4) "pass" +} +array(3) { + ["host"]=> + string(4) "host" + ["user"]=> + string(4) "user" + ["pass"]=> + string(4) "pass" +} +array(2) { + ["host"]=> + string(4) "host" + ["user"]=> + string(4) "user" +} diff --git a/ext/standard/url.c b/ext/standard/url.c index 44a568032b..c159322837 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -201,6 +201,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) STR_FREE(ret->scheme); efree(ret); return NULL; + } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + s += 2; } else { goto just_path; } diff --git a/ext/standard/var.c b/ext/standard/var.c index 494fb583c7..a4fa262e76 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -639,6 +639,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt HashPosition pos; int i; zval nval, *nvalp; + HashTable *propers; ZVAL_NULL(&nval); nvalp = &nval; @@ -664,7 +665,8 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt smart_str_appendl(buf,"N;", 2); continue; } - if (zend_hash_find(Z_OBJPROP_P(struc), Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) { + propers = Z_OBJPROP_P(struc); + if (zend_hash_find(propers, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) { php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); } else { @@ -676,7 +678,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt do { zend_mangle_property_name(&priv_name, &prop_name_length, ce->name, ce->name_length, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_hash_find(Z_OBJPROP_P(struc), priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) { + if (zend_hash_find(propers, priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) { php_var_serialize_string(buf, priv_name, prop_name_length); pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS); php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); @@ -684,7 +686,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS); zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_hash_find(Z_OBJPROP_P(struc), prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) { + if (zend_hash_find(propers, prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) { php_var_serialize_string(buf, prot_name, prop_name_length); pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS); php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); |