mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Revert fix to bug #46903 as per http://marc.info/?l=php-internals&m=123476465621346&w=2 .
This commit is contained in:
parent
ea84127c9e
commit
6262bb4c3d
@ -1342,8 +1342,6 @@ PHP_FUNCTION(ob_start)
|
|||||||
}
|
}
|
||||||
if (chunk_size < 0) {
|
if (chunk_size < 0) {
|
||||||
chunk_size = 0;
|
chunk_size = 0;
|
||||||
} else if (chunk_size == 1) {
|
|
||||||
chunk_size = 4096;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SUCCESS != php_output_start_user(output_handler, chunk_size, flags TSRMLS_CC)) {
|
if (SUCCESS != php_output_start_user(output_handler, chunk_size, flags TSRMLS_CC)) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
Bug #46903 (ob_start(): Special $chunk_size value of 1 is not honoured in HEAD)
|
Bug #46903: ob_start(): In HEAD, $chunk_size value of 1 should not have any special behaviour (Updated as per: http://marc.info/?l=php-internals&m=123476465621346&w=2)
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
function flushCounter($input) {
|
function flushCounter($input) {
|
||||||
@ -20,5 +20,8 @@ echo "1";
|
|||||||
echo "2";
|
echo "2";
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
[1] int(4096)
|
[1] int(1)
|
||||||
12
|
|
||||||
|
[2] 1
|
||||||
|
[3] 2
|
||||||
|
[4]
|
@ -1,12 +1,12 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size.
|
ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size.
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
|
* proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
|
||||||
* Function is implemented in main/output.c
|
* Function is implemented in main/output.c
|
||||||
*/
|
*/
|
||||||
|
// In HEAD, $chunk_size value of 1 should not have any special behaviour (http://marc.info/?l=php-internals&m=123476465621346&w=2).
|
||||||
function callback($string) {
|
function callback($string) {
|
||||||
global $callback_invocations;
|
global $callback_invocations;
|
||||||
$callback_invocations++;
|
$callback_invocations++;
|
||||||
@ -40,7 +40,15 @@ f[call:1; len:8]12345678
|
|||||||
f[call:1; len:8]12345678
|
f[call:1; len:8]12345678
|
||||||
|
|
||||||
----( chunk_size: 1, output append size: 1 )----
|
----( chunk_size: 1, output append size: 1 )----
|
||||||
f[call:1; len:8]12345678
|
f[call:1; len:1]1
|
||||||
|
f[call:2; len:1]2
|
||||||
|
f[call:3; len:1]3
|
||||||
|
f[call:4; len:1]4
|
||||||
|
f[call:5; len:1]5
|
||||||
|
f[call:6; len:1]6
|
||||||
|
f[call:7; len:1]7
|
||||||
|
f[call:8; len:1]8
|
||||||
|
f[call:9; len:0]
|
||||||
|
|
||||||
----( chunk_size: 2, output append size: 1 )----
|
----( chunk_size: 2, output append size: 1 )----
|
||||||
f[call:1; len:2]12
|
f[call:1; len:2]12
|
||||||
@ -85,7 +93,9 @@ f[call:1; len:8]12345678
|
|||||||
f[call:1; len:8]12345678
|
f[call:1; len:8]12345678
|
||||||
|
|
||||||
----( chunk_size: 1, output append size: 4 )----
|
----( chunk_size: 1, output append size: 4 )----
|
||||||
f[call:1; len:8]12345678
|
f[call:1; len:4]1234
|
||||||
|
f[call:2; len:4]5678
|
||||||
|
f[call:3; len:0]
|
||||||
|
|
||||||
----( chunk_size: 2, output append size: 4 )----
|
----( chunk_size: 2, output append size: 4 )----
|
||||||
f[call:1; len:4]1234
|
f[call:1; len:4]1234
|
||||||
|
Loading…
Reference in New Issue
Block a user