diff options
author | Nikita Popov <nikic@php.net> | 2014-07-22 16:55:34 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2014-07-22 18:24:58 +0200 |
commit | d4d4b69e726473f07c11574a3d37cc7b7e65c625 (patch) | |
tree | 0fde99150e335d5c11a751907fbaa2f2c089e2fa /ext/standard/tests/general_functions | |
parent | 43b2973ee75b7256dfce0dd18b725951aac6baf4 (diff) | |
parent | f163f625e804a5e9bd8fe19be4f8552671b2c12b (diff) | |
download | php-git-d4d4b69e726473f07c11574a3d37cc7b7e65c625.tar.gz |
Merge branch 'phpng' into ast
Conflicts:
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Some of dmitry's optimizations are not merged in yet!
Diffstat (limited to 'ext/standard/tests/general_functions')
17 files changed, 189 insertions, 0 deletions
diff --git a/ext/standard/tests/general_functions/bug67498.phpt b/ext/standard/tests/general_functions/bug67498.phpt new file mode 100644 index 0000000000..5b5951b0f8 --- /dev/null +++ b/ext/standard/tests/general_functions/bug67498.phpt @@ -0,0 +1,15 @@ +--TEST-- +phpinfo() Type Confusion Information Leak Vulnerability +--FILE-- +<?php +$PHP_SELF = 1; +phpinfo(INFO_VARIABLES); + +?> +==DONE== +--EXPECTF-- +phpinfo() + +PHP Variables +%A +==DONE== diff --git a/ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt b/ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt Binary files differindex d6d8ae24f3..00180da1ac 100644 --- a/ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt +++ b/ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt diff --git a/ext/standard/tests/general_functions/header_redirection_001.phpt b/ext/standard/tests/general_functions/header_redirection_001.phpt new file mode 100644 index 0000000000..ecf57ec54a --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_001.phpt @@ -0,0 +1,11 @@ +--TEST-- +Location: headers change the status code +--CGI-- +--FILE-- +<?php +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 302 Moved Temporarily +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_002.phpt b/ext/standard/tests/general_functions/header_redirection_002.phpt new file mode 100644 index 0000000000..2bf6dec510 --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers override non-201 and 3xx response codes +--CGI-- +--FILE-- +<?php +header("HTTP/1.1 418 I'm a Teapot"); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 302 Moved Temporarily +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_003.phpt b/ext/standard/tests/general_functions/header_redirection_003.phpt new file mode 100644 index 0000000000..678e3143ac --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_003.phpt @@ -0,0 +1,11 @@ +--TEST-- +Location: headers respect the header() response code parameter +--CGI-- +--FILE-- +<?php +header('Location: http://example.com/', true, 404); +?> +--EXPECTHEADERS-- +Status: 404 Not Found +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_004.phpt b/ext/standard/tests/general_functions/header_redirection_004.phpt new file mode 100644 index 0000000000..678e3143ac --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_004.phpt @@ -0,0 +1,11 @@ +--TEST-- +Location: headers respect the header() response code parameter +--CGI-- +--FILE-- +<?php +header('Location: http://example.com/', true, 404); +?> +--EXPECTHEADERS-- +Status: 404 Not Found +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_005.phpt b/ext/standard/tests/general_functions/header_redirection_005.phpt new file mode 100644 index 0000000000..fc3e0f7af8 --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_005.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 201 response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 201 Created'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 201 Created +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_006.phpt b/ext/standard/tests/general_functions/header_redirection_006.phpt new file mode 100644 index 0000000000..5fb52096ce --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_006.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 300 Multiple Choices response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 300 Multiple Choices'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 300 Multiple Choices +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_007.phpt b/ext/standard/tests/general_functions/header_redirection_007.phpt new file mode 100644 index 0000000000..6769b080fb --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_007.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 301 Moved Permanently response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 301 Moved Permanently'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 301 Moved Permanently +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_008.phpt b/ext/standard/tests/general_functions/header_redirection_008.phpt new file mode 100644 index 0000000000..50993707c1 --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_008.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 302 Found response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 302 Found'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 302 Found +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_009.phpt b/ext/standard/tests/general_functions/header_redirection_009.phpt new file mode 100644 index 0000000000..f8d27f9bfd --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_009.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 303 See Other response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 303 See Other'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 303 See Other +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_010.phpt b/ext/standard/tests/general_functions/header_redirection_010.phpt new file mode 100644 index 0000000000..316112dde7 --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_010.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 304 Not Modified response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 304 Not Modified'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 304 Not Modified +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_011.phpt b/ext/standard/tests/general_functions/header_redirection_011.phpt new file mode 100644 index 0000000000..bfd8789639 --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_011.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 305 Use Proxy response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 305 Use Proxy'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 305 Use Proxy +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_012.phpt b/ext/standard/tests/general_functions/header_redirection_012.phpt new file mode 100644 index 0000000000..657028b09c --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_012.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 307 Temporary Redirect response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 307 Temporary Redirect'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 307 Temporary Redirect +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_013.phpt b/ext/standard/tests/general_functions/header_redirection_013.phpt new file mode 100644 index 0000000000..4dce0d00fa --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_013.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 308 Permanent Redirect response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 308 Permanent Redirect'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 308 Permanent Redirect +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/header_redirection_014.phpt b/ext/standard/tests/general_functions/header_redirection_014.phpt new file mode 100644 index 0000000000..a5fb6e8fec --- /dev/null +++ b/ext/standard/tests/general_functions/header_redirection_014.phpt @@ -0,0 +1,12 @@ +--TEST-- +Location: headers do not override the 399 Choose Your Own Adventure response code +--CGI-- +--FILE-- +<?php +header('HTTP/1.1 399 Choose Your Own Adventure'); +header('Location: http://example.com/'); +?> +--EXPECTHEADERS-- +Status: 399 Choose Your Own Adventure +Location: http://example.com/ +--EXPECT-- diff --git a/ext/standard/tests/general_functions/putenv.phpt b/ext/standard/tests/general_functions/putenv.phpt index afe1badce4..254207320b 100644 --- a/ext/standard/tests/general_functions/putenv.phpt +++ b/ext/standard/tests/general_functions/putenv.phpt @@ -15,6 +15,9 @@ var_dump(getenv($var_name)); var_dump(putenv($var_name)); var_dump(getenv($var_name)); +var_dump(putenv("=123")); +var_dump(putenv("")); + echo "Done\n"; ?> --EXPECTF-- @@ -25,4 +28,10 @@ bool(true) string(0) "" bool(true) bool(false) + +Warning: putenv(): Invalid parameter syntax in %s on line %d +bool(false) + +Warning: putenv(): Invalid parameter syntax in %s on line %d +bool(false) Done |