php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54639 output_add_rewrite_var can only be used once
Submitted: 2011-04-30 12:30 UTC Modified: 2013-09-26 15:07 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: fl at nyggen dot com Assigned:
Status: Open Package: *General Issues
PHP Version: 5.3SVN-2011-04-30 (snap) OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-04-30 12:30 UTC] fl at nyggen dot com
Description:
------------
The output_add_rewrite_var can only be used once, the second time it fails.

More on this problem here: http://stackoverflow.com/questions/5822936/output-add-
rewrite-var-problems

Test script:
---------------
// outer buffer
ob_start();

print_r(ob_list_handlers());

// inner buffer 1
ob_start();
output_add_rewrite_var('var', 'value');
print_r(ob_list_handlers());
ob_end_flush();

print_r(ob_list_handlers());

// inner buffer 2
ob_start();
output_add_rewrite_var('var', 'value');
print_r(ob_list_handlers());
ob_end_flush();

print_r(ob_list_handlers());

Expected result:
----------------
Output should have been:

Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
Array
(
    [0] => default output handler
)

Actual result:
--------------
Output is:

Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => default output handler
)
Array
(
    [0] => default output handler
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-26 15:07 UTC] mike@php.net
-Type: Bug +Type: Documentation Problem
 [2013-09-26 15:07 UTC] mike@php.net
Yes, this odd output handler can only be used once.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Sep 20 17:01:26 2018 UTC